Intermittent GDI Crash

Declan McMullen declan.mcmullen at gmail.com
Mon Apr 7 05:53:10 PDT 2008


Hey guys,

I'm getting an intermittent failure in my program and I cant seem to find
out why
heres the code

if(oldImage.compare(image) !=3D 0 || refreshImage)
    {
        overlayImage.Destroy();
        overlayImage =3D wxImage(image);
        wxSize size =3D this->GetSize();
        overlayImage.Rescale(size.GetWidth(), size.GetHeight());

        bitmap =3D wxBitmap(overlayImage);
        oldImage =3D image;
        refreshImage =3D false;
    }
    dc.DrawBitmap(bitmap, 0, 0, false);


If creates a wxImage, rescales it to match the width and height of the panel
im placing it in, then converts it
to a dc for drawing. If the image hasnt change since the last draw I redraw
the old image.

When it crashed it brings me to this method from gdiplusgraphics.h
I've placed an arrow where the debug arrow is

SmoothingMode GetSmoothingMode() const
    {
        SmoothingMode smoothingMode =3D SmoothingModeInvalid;

        SetStatus(DllExports::GdipGetSmoothingMode(nativeGraphics,
->                                                   &smoothingMode));

        return smoothingMode;
    }

I'm using visual c++ 2005

Sometimes it works fine sometimes it crashes, I havent been able to find a
pattern to the crashes.

Its probably something small im doing wrong.
Any information much appreciated



-- =

http://www.computing.dcu.ie/~dmcmullen
declan.mcmullen at computing.dcu.ie
School of Computing
Postgrad Bay A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20080407/bd4=
4d2a7/attachment.htm


More information about the wx-users mailing list