Drawing on an image gadget?

Just starting out? Need help? Post your questions and find answers here.
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Drawing on an image gadget?

Post 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()
...
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

GetGadgetState() returns the image ID, ImageOutput() requires the image number.
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post 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.
Post Reply