Sign in to follow this  
Followers 0
Nerdworld

GDI functions on minimized windows

3 posts in this topic

#1 ·  Posted (edited)

Hey folks!

I'm currently drawing an image on a GUI.

Global $preview = _GDIPlus_GraphicsCreateFromHWND($gui_main)
[...]
Local $new = _GDIPlus_ImageLoadFromFile($PATH_PREVIEW)
_GDIPlus_GraphicsDrawImageRect($preview, $new, [...])
[...]
_GDIPlus_ImageDispose($new)

But now i found out that the images won't be painted if the window is minimized or invisible.

My first idea was to WinActivate the main gui everytime the image is getting updated, but the same problem appears on _GUICtrlStatusBar_SetIcon - which is getting called when i don't want to maximize the whole GUI everytime.

Is there any way to paint images on hidden windows except drawing it in a loop?

The only things i can imagine are some dirty workarounds with WM_PAINT or listening for WinActivate-events.

Regards, Daniel

Edited by Nerdworld

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You can use the WM_PAINT message handler to repaint your image to the gfx handle or you just send the image to a picture control which will be repainted by the os automatically.

Btw, it is GDI+ not GDI! ;)

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

You can use the WM_PAINT message handler to repaint your image to the gfx handle or you just send the image to a picture control which will be repainted by the os automatically.

Btw, it is GDI+ not GDI! ;)

Br,

UEZ

 

Well, saying it's GDI+, not GDI is like saying "That's not Windows. It's Windows 7." :D

Okay - so i'll give it a try with WM_PAINT...

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