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;
bmp: TBitmap32;
png: TPortableNetworkGraphic32;
rlayer: TCustomLayer;
img1, img2, img3: TImgView32;
begin
bmp := TBitmap32.Create;
bmp.Assign(imgPreview.Picture); // TImage obj already have a JPG loaded
img1 := TImgView32.Create(nil);
img1.Bitmap := bmp;
img2 := TImgView32.Create(nil);
img2.Bitmap.LoadFromFile('C:\\layer2.png');
img3 := TImgView32.Create(nil);
img3.Bitmap.LoadFromFile('C:\\watermark.png');
rlayer := TCustomLayer.Create(nil);
rlayer.LayerCollection.Add(img1.Layers.Items[0]); // [DCC Error] Incompatible types: 'TLayerClass' and 'TCustomLayer' ????
...
How can I add a new layer to collection? And after all, how can I save this?