Intermittent GDI Crash
Declan McMullen
declan.mcmullen at gmail.com
Mon Apr 7 06:50:59 PDT 2008
On Mon, Apr 7, 2008 at 2:45 PM, Stefan Csomor <csomor at advancedconcepts.ch>
wrote:
> Hi
>
> I assume the problem lies at the place where the wxDC is set-up, is this
> an ordinary Paint handler ? how are you setting it up ?
>
Hi,
wxPaintDC pdc(this);
wxGCDC dc(pdc);
I also tried it without the graphics context and it still failed
intermittently.
>
> Best,
>
> Stefan
>
>
> On 07.04.08 14:53, "Declan McMullen" <declan.mcmullen at gmail.com> wrote:
>
> 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
>
>
>
> --
>
> Advanced Concepts AG
> Software-Engineering
> Heldweg 10
> CH-8475 Ossingen
> Switzerland
>
> phone:+41 52 245 0 245
> fax:+41 52 245 0 246
> http://www.advanced.ch
> mailto:csomor at advanced.ch <csomor at advanced.ch>
>
>
> _______________________________________________
> wx-users mailing list
> wx-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-users
>
>
-- =
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/2c3=
a95ce/attachment-0001.htm
More information about the wx-users
mailing list