Re: Error 480 - can't create autoredraw image
- From: "Mike D Sutton" <EDais@xxxxxxxx>
- Date: Tue, 29 Aug 2006 01:05:41 +0100
I'm trying to do a simple crop by
loading a JPG into a picturebox,
then PaintPicture to a second box
with size set to the crop region.
Very simple. It works fine but fails
on certain images. The one picture
I have that fails is 2500 x 1700 pixels
(approx.), from a digital camera. And
other pics saved from the same camera
seem to fail, even though they open
fine in IrfanView or PaintShopPro.
Is the picture just too big? Should I do it
a different way?
VB's back-buffer implementation uses a Device Dependant Bitmap (DDB) to store the image data, which is quite limited in
how large it can be made. On older OS' this used to be ~16mb uncompressed data size, on later OS this has been expended
but is still quite restrictive.
The image you describe would take just over 16mb uncompressed space at 32-bit so this looks like it's hitting that
boundary.
A workaround for this is to use a Device Dependant Bitmap (DIB) and manage the GDI resources yourself, have a look at
the DIB article on my site for an example of how to work with them.
Hope this helps,
Mike
- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/
.
- Follow-Ups:
- Re: Error 480 - can't create autoredraw image
- From: mayayana
- Re: Error 480 - can't create autoredraw image
- References:
- Error 480 - can't create autoredraw image
- From: mayayana
- Error 480 - can't create autoredraw image
- Prev by Date: Re: Error 480 - can't create autoredraw image
- Next by Date: Re: printing problem: print # command
- Previous by thread: Re: Error 480 - can't create autoredraw image
- Next by thread: Re: Error 480 - can't create autoredraw image
- Index(es):
Relevant Pages
|