Jump to content

GDI+, when to launch and close


gi_jimbo
 Share

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.

or

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?

Jimbo

Using AutoIt v3.3.14.5 and SciTE version 4.2.0

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...