Page 1 of 1

Drawing on an image gadget?

Posted: Sat May 06, 2006 1:06 pm
by dmoc
Edit: PBv4b11 (if only we had a seperate forum :? )

I used the visual designer to create my interface. On it are several image gadgets set up via the vd in the usual way, ie, a constant, a global, catch the image from included binary, create an image gadget using the global for the image ID. Images are .png's and appear fine. Now I want to draw on the image and update the gadget (similar to what Fred suggests for drawing on an apps window). So I should be able to do the following right? But it always comes back with an error "#Image object not initialized".

Code: Select all

...
    myImageID = GetGadgetState(myGadgetID)
    StartDrawing(ImageOutput(myImageID))
      Line(0,0,15,15)
    StopDrawing()
...

Posted: Sat May 06, 2006 5:28 pm
by Trond
GetGadgetState() returns the image ID, ImageOutput() requires the image number.

Posted: Sun May 07, 2006 6:57 am
by dmoc
OK, my mistake. I'm trying to get back to "image number" from "gadget id". I guess the way to do it is to store the image number in the image gadget using SetGadgetData() when I create it.