Inconsistent GDIPlus error message

Windows 7/window 8

A few times out of a couple dozen runs, “PlatformNotSupportedException” “exception message:creating a picture with alpha channels only works if App.UseGDIPlus is enabled” reers its ugly head.

GDIPlus is enabled, and I’ve thrown an

If App.UseGDIPlus =False then
Msgbox “I need to be enabled somethings wrong”
End if

Into the open event. … which never shows the message box… meaning that the application recognizes GDIPlus is enabled. … but when it comes down to:

Dim xPic as Picture = New Picture (200, 200)

The program complains about GDIPlus (not every run)…

The issue is that it works ALMOST everytime… something is very inconsistent and strange. …bug?

Are you sure you aren’t setting it to false somewhere else in the code and you just don’t remember doing it? And maybe that code is only rarely called?

The only app.usegdiplus is in the open event to see if it’s enabled (after I started getting the crash)…it was enabled using the inspector…im baffled…the draw only happens once at startup…works about 19 out of 20 runs…then the one time running crashes…only to run perfectly when re-run.

Is this happening in the open event of the app? Could it be that GDIPlus hasn’t initialized yet? (not that it should matter)

No…the application loads…user logs in…then the custom progresswheel starts spinning as the user is being signed on :frowning: very frustrating since now I posted about it earlier, it hasn’t happened again…although I’ve had instances where I’ve re-run the code about 50 consecutive times (on purpose :-p) before it occurred again. I’ve had a couple inconsistencies today. One, I just posted about with a demo attached about “class problem…”…and oddly, the demo app class uses the SAME EXACT methodology as in the SimDesignerCanvas I recently released. But the strange part is, in the SDC it works…in the demo app I just posted for testing in the thread…the method doesn’t work :-/

Matt, just before creating the new picture, set app.UseGDIPlus = True and see if that works for you.