Page 1 of 1

Vector Drawing. User Applied ID for Layer

Posted: Sun Mar 29, 2020 5:21 pm
by IdeasVacuum
If Vector Layers could be given ID's, that would lend greater flexibility.
It would be very useful to be able to Show/Hide layers individually and to Delete Layers.

This capability is common in the world of drawing.

Re: Vector Drawing. User Applied ID for Layer

Posted: Sun Mar 29, 2020 5:41 pm
by freak
The EndVectorLayer() command draws the finished layer on the layer below. The layer stops existing after that. You can't modify it later.

Re: Vector Drawing. User Applied ID for Layer

Posted: Sun Mar 29, 2020 8:01 pm
by IdeasVacuum
... I'm aware of that Freak, hence my request.

Re: Vector Drawing. User Applied ID for Layer

Posted: Thu Sep 30, 2021 7:23 am
by collectordave
I remember needing something like this as well.

I started by creating transparent images for each layer I needed.

Layer 0 was always used to draw on then when the drawing was finished Image(0) was copied to the current layer image.

Then updating the drawing on the canvas by drawing each enabled layer image onto the canvas.

I will look for my code but hope this helps.

Re: Vector Drawing. User Applied ID for Layer

Posted: Thu Sep 30, 2021 3:22 pm
by collectordave
Well I have found my notes.

Each layer was an image with a transparent background.

I stored the paths along with colour, stroke and layer number etc in a structured list

You get the paths with Pathsegments()

When loading, each layer is drawn first then they can all be combined into one image on a canvas.

Each layer can be turned on or off and transparency set for each layer.

Hoping my code is not on the my crashed PC.

Will keep looking.