ripdad Posted February 14, 2020 Share Posted February 14, 2020 This is what I want to do: 1. Load a regular image using GUICtrlCreatePic() onto the GUI. 2. Load a completely transparent image in GDIPlus on top of the GUI image. 3. Draw on the transparent image. 4. Redraw/Clear the transparent image when ready. It works, but there's a problem. It draws, but I can't get it to clear the previous drawing. So, I made a half transparent, half background color (yellow) image. What does it do? (shaking my head) It clears the yellow half, but not the transparent half of the same image. This doesn't make any sense to me. Any suggestions? I would appreciate it! I don't need help with the script -- I just need an explanation why, and/or perhaps some kind of work-around. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
rm4453 Posted February 14, 2020 Share Posted February 14, 2020 2 words: Example Code Link to comment Share on other sites More sharing options...
ripdad Posted February 14, 2020 Author Share Posted February 14, 2020 22 minutes ago, rm4453 said: 2 words: Example Code 2 words: won't help. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
rm4453 Posted February 14, 2020 Share Posted February 14, 2020 6 minutes ago, ripdad said: 2 words: won't help. Write another image *black?* over the clear portion, then re-write the clear portion after clearing the black portion? Link to comment Share on other sites More sharing options...
ripdad Posted February 14, 2020 Author Share Posted February 14, 2020 As I understand it, a layer on top of another layer is just that. But hey, I will give it a shot, just to be thorough. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ripdad Posted February 14, 2020 Author Share Posted February 14, 2020 It didn't work. I would expect that it would clear whatever I draw on the transparent image. It doesn't. It's like it's ignoring the transparency layer and writing directly to the GUI dialog. If I'm working with transparency layers in an image editor, and I delete a layer, it's gone, along with whatever I drew on that layer. So, this is not making much sense with GDIPlus. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
rm4453 Posted February 14, 2020 Share Posted February 14, 2020 21 minutes ago, ripdad said: It didn't work. I would expect that it would clear whatever I draw on the transparent image. It doesn't. It's like it's ignoring the transparency layer and writing directly to the GUI dialog. If I'm working with transparency layers in an image editor, and I delete a layer, it's gone, along with whatever I drew on that layer. So, this is not making much sense with GDIPlus. Try re-writing the var that contains the transparent image then re-writing it again to contain the transparent image...? or maby it is actually drawing on the gui and not the image? Link to comment Share on other sites More sharing options...
ripdad Posted February 14, 2020 Author Share Posted February 14, 2020 Tried that using _GDIPlus_ImageGetGraphicsContext(), which contains the image. No success. Also tried a series of "Dispose". I shouldn't have any problems with this, since it will work with any normal image; even when I look behind them. I suppose it might be some kind of quirk or bug at this point. Just like to cover all my bases here. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ripdad Posted February 15, 2020 Author Share Posted February 15, 2020 rm4453, Found the solution... _GDIPlus_GraphicsClear() Should have known that, but I've never used it before. Thanks for your help. rm4453 1 "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now