Intermittent GDI Crash
Stefan Csomor
csomor at advancedconcepts.ch
Mon Apr 7 06:45:39 PDT 2008
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 ?
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) != 0 || refreshImage)
> {
> overlayImage.Destroy();
> overlayImage = wxImage(image);
> wxSize size = this->GetSize();
> overlayImage.Rescale(size.GetWidth(), size.GetHeight());
>
> bitmap = wxBitmap(overlayImage);
> oldImage = image;
> refreshImage = 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 = 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20080407/68fc5040/attachment.htm
More information about the wx-users
mailing list