graphics32

TBitmap32.LoadFromStream() Auto-Recognize Image Format

孤人 提交于 2020-01-14 10:23:23
问题 I'm using Delphi XE2 (Update 3) and GR32. I am unable to use TBitmap32.LoadFromStream() to load the image data. It raises the following exception: Project MyApp.exe raised exception class EInvalidGraphic with message 'Bitmap image is not valid'. Code uses GR32, GifImg, PngImage, Vcl.Graphics; var pic: TBitmap32; bs: TBytesStream; begin bs := TBytesStream.Create(TClientDataSet(cds).FieldByName('filedata').AsBytes); try pic := TBitmap32.Create; try // bs.SaveToFile('c:\delme.png'); // pic

Delphi Graphics32 how to draw a line with the mouse on a layer

半世苍凉 提交于 2020-01-05 15:26:22
问题 Can anybody help me convert this great method of dynamically drawing a line (Photoshop style drawing line with delphi) to Graphics32? I mean, I want to have a ImgView, add a new layer to it, then perform these methods on the layer instead of the form's canvas. So I assume, my code should look like this: private FStartPoint, FEndPoint: TPoint; FDrawingLine: boolean; bm32: TBitmap32; ... procedure TForm1.FormCreate(Sender: TObject); begin bm32 := TBitmap32.Create; FDrawingLine := false; end;

Delphi TImage32 - how to make the component invisible if no picture is loaded?

烈酒焚心 提交于 2019-12-24 13:47:12
问题 If you place a normal TImage component on a form or panel over other components >> it is invisible at runtime as long no picture is loaded. So other things under it are visible. But TImage32 is painting a gray box by default. How do I make the it invisible while leaving the setting: .Visible:=True; if no picture is loaded? (I still need events working on the component, like OnClick...) Yes, this is a duplicate question, BUT the solution-link from the previous topic is dead. :( 回答1: While I

How do I render text along an arc in an image?

吃可爱长大的小学妹 提交于 2019-12-24 13:05:14
问题 I have the following code in Delphi 7 to draw Copyright text along the curved edge of a DVD. We are using an old version of Graphics32. We are switching to Delphi XE5 with the latest code from Graphics32 and this code no longer compiles; in particular LoadArcCurve and drawingBuffer.RenderFittedText no longer exists as methods. procedure TCDLabel.DrawCopyrightText(const drawingBuffer: TBitmap32Ex); var FixedPointArray : TArrayOfFixedPoint; Center : TFixedPoint; vAngle1 : double; vAngle2 :

Delphi Graphics32 - edit layer, erase parts of TBitmap32 (layer)

雨燕双飞 提交于 2019-12-24 04:49:10
问题 Is it possible to edit a layer's image? I mean, having a TImgView with multiple selectable layers, I would like to know if it is possible to select one layer (rubber-band and all), and for example click a button in the menu, and the mouse would turn into a rubber eraser that can delete contents under the mouse, on click. Just like the eraser in Paint.net or Photoshop. Is it possible to achieve this? And if so, then how? I could not find a way of doing that so far. In regular TImage (TPaintBox

Delphi, GR32 + PngObject: converting to Bitmap32 doesn't work as expected

安稳与你 提交于 2019-12-18 16:57:20
问题 I'm using GR32 for drawing multiple semi-transparent PNG images. So far I've been using the following method: png:= TPNGObject.Create; png.LoadFromFile(...); PaintBox321.Buffer.Canvas.Draw(120, 20, png); however I wanted to switch to the method proposed on GR32 website (http://graphics32.org/wiki/FAQ/ImageFormatRelated) : tmp:= TBitmap32.Create; LoadPNGintoBitmap32(tmp, ..., foo); tmp.DrawMode:= dmBlend; PaintBox321.Buffer.Draw(Rect(20, 20, 20+ tmp.Width, 20+tmp.Height), tmp.ClipRect, tmp);

Delphi, GR32 + PngObject: converting to Bitmap32 doesn't work as expected

夙愿已清 提交于 2019-12-18 16:57:04
问题 I'm using GR32 for drawing multiple semi-transparent PNG images. So far I've been using the following method: png:= TPNGObject.Create; png.LoadFromFile(...); PaintBox321.Buffer.Canvas.Draw(120, 20, png); however I wanted to switch to the method proposed on GR32 website (http://graphics32.org/wiki/FAQ/ImageFormatRelated) : tmp:= TBitmap32.Create; LoadPNGintoBitmap32(tmp, ..., foo); tmp.DrawMode:= dmBlend; PaintBox321.Buffer.Draw(Rect(20, 20, 20+ tmp.Width, 20+tmp.Height), tmp.ClipRect, tmp);

Transparent Png to TBitmap32

非 Y 不嫁゛ 提交于 2019-12-17 19:52:40
问题 I have a png that i would like to load in a TBitmap32. After I load the bitmap I call: Bitmap.DrawMode := dmTransparent; Bitmap.OuterColor := Bitmap.PixelS[0,0]; But then all white pixels are transparent. How can i do that just for the transparent part of the png image? Here is my image with the alpha transparency around the edge of the image indicated in the standard way. And this is the actual image: 回答1: It seems that TBitmap32 may lose alpha information while loading a PNG image. You may

Graphics32 - saving transparent drawing layer to png

与世无争的帅哥 提交于 2019-12-13 19:04:55
问题 I draw a dotted line on a layer of an ImgView32. Later, I want to save each layer as transparent PNGs. For any other layer that I have, the saving works just fine. But for the drawing layer, it does not. In order to make the question simpler to understand, take the example code from the gr32 library, more specifically the Layers example. One of the options in its main menu is to add a custom drawing layer (New Custom Layer -> Simple Drawing Layer). Then try to save that layer as a transparent

Delphi - Graphics32, draw multiple transparent PNG over JPG as watermak

試著忘記壹切 提交于 2019-12-13 01:40:23
问题 After read Graphics32 documentation I can't find a objetive example of use layers. I just want to compose the following Image: Layer 1 - Background Image (In JPG) (800x600) Layer 2 - Transparent PNG as a frame border (800x600) Layer 3 - Transparent PNG on right bottom with 25º Rotation (90x90) And this is the expected result: // uses => GR32, GR32_Layers, GR32_Png, GR32_Image; procedure TMain.Button1Click(Sender: TObject); var // src, dest: TPNGObject; <-- another frustrating try // r: TRect;