Vincent Povirk madewokherd@gmail.com wrote:
an image passed to GdipGetImageGraphicsContext() is destroyed right after the graphics object was created, then later on all calls using that HDC fail and silently lead to using invalid or not initilazed values.
You have to keep the image alive as long as you're using the Graphics object. If you're not doing that, then you have a use-after-free and I don't trust the results of your test.
You are welcome to experiment with the test and try to prove that its results depend on the availability of an image. My tests show that image after the GdipGetImageGraphicsContext() call can be safely destroyed, and the test results don't depend on it.