Sign in to follow this  
Followers 0
Szhlopp

GDI plus help. Deleting an object

4 posts in this topic

If I use GDIplus to draw a rectangle. How do I delete this rectangle? I can use the clear function but it makes the whole screen go black.

Thanks!

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

My crystal ball is unable to see your code... Its a little cloudy today. muttley

meh

If I just want to delete the rectangle. How would I do it?

Yes I can use "EEEEEE" as the background color on a clear. But if I have controls on the forum I have to put my mouse over them again the see them.

I want to be able to functionally call something like this up. And when ever I want be able to just delete it with any controls on the forum not being effected and the background color the same.

#include <gdiplus.au3>
#include <GUIConstants.au3>
;

_GDIPlus_Startup()
$mygui = GUICreate("tester", 400, 400)
$hWnd = WinGetHandle("tester")
GUISetState()
;WinSetTrans($hWnd, "", 50)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)






$hBrush1 = _GDIPlus_BrushCreateSolid(0xFF999999)
_GDIPlus_GraphicsFillRect($hGraphic, 10, 10, 50, 50, $hBrush1)






while 1 

$msg = GUIGetMsg()

Switch $msg
    
    Case $GUI_EVENT_CLOSE
        Exit
        
EndSwitch




WEnd
Edited by Szhlopp

Share this post


Link to post
Share on other sites

A rectangle isn't an object. It's a set of pixels that have been sent to the hardware after some software processing. The only way to delete them is to repaint the area you originally covered.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0