T O P I C R E V I E W |
Fishous |
Posted - Aug 29 2012 : 05:14:20 I'm using version 4.1.0, TImageEnVect and TImageEnMView, to make a simple image editing app that supports layers and objects.
I'm using multiple user created layers (Transparency=opaque), and objects assigned to individual layers so they can all be seen at the same time and I'm using Proc.SetTransparentColors to set the "background" color of the layer to transparent. This allows layered drawing.
The problem is that when doing so, only objects on the topmost visible layer can be selected with MouseInteractVt = miObjectSelect.
For example, in the included screen shot, with a rectangle object on each layer, only the rectangle object on layer 1 can be selected, regardless of which layer is the current layer.
Is this a limitation or am I doing something wrong? I've thought of using FindObjectAt in the mouse down to attempt to work around it, but wanted some feedback first before implementing that.
Edited to add: 1. I'm using ObjAnchorToLayers := true to anchor objects to layers. 2. I can't seem to get FindObjectAt to work.
|
2 L A T E S T R E P L I E S (Newest First) |
Fishous |
Posted - Aug 30 2012 : 04:57:50 No, the yellow rectangle on the background is still an object, the thumbnails of the layers are generated by copying/merging layers and objects to a separate control, not simply the layer bitmap.
Regardless of how many layers there are, only objects "on" the topmost visible layer (assigned via ObjLayer) can be selected when ObjAnchorToLayers = true.
Yes, I've looked through all of the annotation (object) and layer demos extensively (as well as most others), but none use multiple layers and objects, let alone an opaque layer with Proc.SetTransparentColors used to make it transparent so that it's bitmap is transparent but objects are visible.
I've found that if I set ObjAnchorToLayers = false it works, but that brings about other issues with objects that I'm currently looking into, such as the objects appearing over the top of all layer background bitmaps. (I'm using the layer bitmap to allow the user to draw individual pixels (draw pencil, brush spray, etc) on top of objects (in lower layers), so ObjAnchorToLayers = false breaks that)
I did find that when ObjAnchorToLayers = true that FindObjectAt only works for objects assigned to the topmost layer. When false it works for all objects assigned to any layer (which makes sense).
I'm probably going to create a sample app to demonstrate the issue, is Delphi 6 OK for a demo? |
xequte |
Posted - Aug 29 2012 : 17:54:42 Hi
The screenshot you have here shows that the yellow rectangle has been applied to the background layer, so it will no longer be selectable (i.e. its part of the background image and no longer a separate layer/object).
Have you investigated the layer editing demo in your ImageEn folder:
\demos\ImageEditing\Layers\Layers.dpr
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
|
|