Re: Display a bitmap from Win32, unmanaged code?
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Tue, 05 May 2009 10:19:37 -0700
On Tue, 05 May 2009 08:45:00 -0700, bsnguy <bsnguy@xxxxxxxxxxxxxxxx> wrote:
[...]
So I said "hey, dispose of the bitmap" and I added
theBitmap.Dispose();
This works, for a while. The problem is that depending on what I do in the
UI, it seems that the bitmap is being disposed before the picturebox has
actually displayed it and I get an exception. Is there a better way to handle this?
Yes. Don't dispose the bitmap until you're done with it. That is, wait until just before you've got a new one before you dispose the old one.
Pete
.
- Follow-Ups:
- Re: Display a bitmap from Win32, unmanaged code?
- From: bsnguy
- Re: Display a bitmap from Win32, unmanaged code?
- References:
- Display a bitmap from Win32, unmanaged code?
- From: bsnguy
- Display a bitmap from Win32, unmanaged code?
- Prev by Date: Re: big-endian and little-endian
- Next by Date: Re: converting images to thumbnails
- Previous by thread: Display a bitmap from Win32, unmanaged code?
- Next by thread: Re: Display a bitmap from Win32, unmanaged code?
- Index(es):
Relevant Pages
|