VSmolensky
asked on
Multi-layered image in FireMonkey
In my VCL project, I use a third-party component TImage32 which can have a lot of layers (each layer is a bitmap). It is very convenient for drawing BW pictures: each layer contains one stroke; the white color is transparent, so you can see all the strokes in the same time but process them individually.
Now I'm porting all the project to FireMonkey. TImage32 is not supported there, so I'm thinking now whether it's possible to do the same without any thirt-party controls. FireMonkey looks very powerful and flexible but so far I couldn't find anything like a multi-layered image among its components. Maybe, there's a way to easily build such an image yourself?
Now I'm porting all the project to FireMonkey. TImage32 is not supported there, so I'm thinking now whether it's possible to do the same without any thirt-party controls. FireMonkey looks very powerful and flexible but so far I couldn't find anything like a multi-layered image among its components. Maybe, there's a way to easily build such an image yourself?
have you got a few sample images ?
ASKER
Is my question really that sophisticated? OK, here's one image. The multicolored lines are all mouse-drawn by a user on different transparent canvases which all belong to the same TImage32. That's why the program can individually delete, restore or modify these lines. I just want to know if a FireMonkey component (a TImage or a TPaintBox) can also have several canvases for drawing.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you! BTW, what kind of sample images did you want from me? images of my source code?
Anyway, my compiler is unhappy just about one line:
image1.Picture.Assign(x);
E2003 Undeclared identifier: 'Picture'
What should I check?
Anyway, my compiler is unhappy just about one line:
image1.Picture.Assign(x);
E2003 Undeclared identifier: 'Picture'
What should I check?
i haven't got firemonkey installed.
it should be the property for the actual image of the TImage class
ah ... bitmap in this case:
http://docwiki.embarcadero.com/Libraries/Seattle/en/FMX.Objects.TImage_Properties
object.bitmap.assign(x);
dunno what "object" you use to display images
i found a few TRectangle entries
it should be the property for the actual image of the TImage class
ah ... bitmap in this case:
http://docwiki.embarcadero.com/Libraries/Seattle/en/FMX.Objects.TImage_Properties
object.bitmap.assign(x);
dunno what "object" you use to display images
i found a few TRectangle entries
ASKER
Is your code written completely in VCL? I understand the idea behind it, but still can't duplicate it in FireMonkey. Even after replacing your USES section by FMX.Types, FMX.Controls, etc., my compiler doesn't like the following "undeclared identifiers":
bmp.Transparent
Canvas.Lock / Unlock
Canvas.Draw
bmp.Transparent
Canvas.Lock / Unlock
Canvas.Draw
firemonkey ... it's like going back to the 20th century
without the transparent it's more difficult ...
this would mean you need to create a region of the rectangle and subtract the white pixels
then paint via the region
not sure if regions are supported by the firemonky api
it's very limited
probably that's why not a lot of people use it
without the transparent it's more difficult ...
this would mean you need to create a region of the rectangle and subtract the white pixels
then paint via the region
not sure if regions are supported by the firemonky api
it's very limited
probably that's why not a lot of people use it
ASKER
Actually, there is transparency in FireMonkey, you can provide it with the Alpha channel. I still haven't managed to do in FireMonkey what you suggest for VCL, but it seems to be possible. I'll keep trying. Thank you anyway, I accept your solution,