Jump to content
Sign in to follow this  

GDI+, when to launch and close

Recommended Posts


I'm curious which of the following is better practice.

Use _GDIPlus_Startup() and _GDIPlus_Shutdown() once (at program launch and exit) and keep the GDI+ lib running, not knowing how many times the GUI user will run functions that make use of the GDI functions.


Call _GDIPlus_Startup() and _GDIPlus_Shutdown() each time the user runs a function that requires use of the GDI functions.

For some context, I'm writing a GUI that loads picture names from a directory as children into a treeview.  When the user selects one of the picture names I'd like a properly scaled thumbnail of the image to show up in an image frame on the GUI.   This is only a small part of the GUI so it's certainly not the main function therefore it's not like GDI+ will be used constantly.  However, the user may click on a various number of the image names in succession before finding the one they're interested in.  I'm wondering if it may even be better to track when a user first clicks in the treeview and start GDI+ then and shut it down the next time they click outside the treeview.   This treeview is also in a tab so maybe launch it when the tab is activated and close it when the user leaves the tab?

I just don't know and guess I could just pick one but figured there'd be someone here who would know better.  Thoughts?


Using AutoIt v3.3.14.3 and SciTE version 3.7.3

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