I have hard time with drawing on a Canvas:
I put some Black pixels in the Paint Event (set in an offscreen Picture),
I put the original image in the Backdrop (loaded from file).
At last, I have now something (not what I want, but something) in the offscreen picture, but it does not appears in the canvas. Fortunately, the debugger is able to display it to me.
The current suspect is who is frontmost: the .Backdrop contents or what is draw in the Paint Event ?
I just set my Canvas1.Backdrop
to Nil
once I finished to create the offscreen picture, and now I get its contents.
So, the layer seems to be:
Frontmost: Canvas1.Backdrop
,
Next layer: what is in the Paint Event
For unknow reason, I expected the reverse !
Writing a new Conversation serves (sometimes) to find a solution. I post this 'cause it may be useful.
Notes:
a. The following sentence is IMHO misleading:
You should not assign a new picture to the backdrop of the control when being inside the paint event of that control. This can lead into problems like the backdrop not being painted.
That is exactly what Ive done in my Paint event (fake code: If the_Pict <> Nil Then Paint it
!)
b. I searched in Paint Event (http://documentation.xojo.com/topics/user_interface/desktop/desktop_controls/canvas.html#canvas-paint) and Backdrop (http://documentation.xojo.com/topics/user_interface/desktop/desktop_controls/canvas.html#canvas-backdrop): not a single word about layer.
Now, I will try to invert the code in my project (to get the layers in the correct order), check the results and do the right write if this works.