Jump to content
Sign in to follow this  
JFee

Freeze GDI+ objects from redraw

Recommended Posts

JFee

So I have painted an image onto my window using GDIPlus functions, but when the window gets redrawn, the GDI stuff I drew doesn't get redrawn with it.

Is there a way to do lock the GDI graphic without doing manual redrawing? I have tried using GUIRegisterMsg($WM_PAINT, "_ReDraw") and having _ReDraw draw the image again, but it crashes whenever it tries to redraw it.

Func _ReDraw()
    If $gPreviewBox <> 0 And $imgBackground <> 0 Then
        _GDIPlus_Startup()
        _GDIPlus_GraphicsDrawImageRect($gPreviewBox, $imgBackground, 0, 0, 720, 486)
        _GDIPlus_Shutdown()
    EndIf
EndFunc;==>_ReDraw

The if statement just makes sure its been drawn once already


Regards,Josh

Share this post


Link to post
Share on other sites
JFee

Alright, so I got the redraw thing to work (one gdi startup and one gdi shutdown total), but when I maximize the window, it redraws and then the pic control that it draws on top of goes on top of it. I am not sure what is happening here


Regards,Josh

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.