 |
|
|
|
| Author |
Message |
Noble Bell
Joined: 08 Aug 2007 Posts: 2
|
Posted: Tue Jan 29, 2008 3:32 pm Post subject: Picture Box oddities |
|
|
I have an app with 4 picture box controls on it and I need to load images
into the picture boxes. I have the picture boxes set to 216,162 in size and
the property set to "Stretch Image". While loading image sizes of 800x600
there is not a problem but when I try to load an image size that is 166x1200
everything blows up and tells me it is throwing an out of memory error. How
can this be when the 800x600 image is only a few "k" smaller in size than the
1600x1200 image?
Thanks in advance,
--
Noble D. Bell
www.noblesoftware.com
Archived from group: microsoft>public>dotnet>framework>compactframework |
|
| Back to top |
|
 |
user
Joined: 08 Aug 2007 Posts: 286
|
Posted: Tue Jan 29, 2008 5:40 pm Post subject: Re: Picture Box oddities |
|
|
800x600 is a lot more than just a few k smaller than 1600x1200. Let's
assume the image is only 16bpp color depth (and it could be 24).
800x600 = 240,000 pixels * 2 byes per pixel = 480k bitmap;
1600x1200 = 1,920,000 pexels * 2 bytes per pixel = 4MB bitmap;
If you have 4 of these then we're talking 16MB needed just to hold the
bitmaps you want to show. I can see how that might cause an OOM.
Remember, the PictureBox can't "display" a raw JPG, it has to be
uncompressed to a bitmap to be shipped to GDI and displayed. That's not a
"managed" thing either, this is the case for any image created under any
environment and really under any OS (unless there is a hardware decoder
somewhere in the pipeline, but that's outside the scope of what we're
talking about here).
--
Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com
"Noble Bell" wrote in message @microsoft.com...
>I have an app with 4 picture box controls on it and I need to load images
> into the picture boxes. I have the picture boxes set to 216,162 in size
> and
> the property set to "Stretch Image". While loading image sizes of 800x600
> there is not a problem but when I try to load an image size that is
> 166x1200
> everything blows up and tells me it is throwing an out of memory error.
> How
> can this be when the 800x600 image is only a few "k" smaller in size than
> the
> 1600x1200 image?
>
> Thanks in advance,
>
> --
> Noble D. Bell
> www.noblesoftware.com
> |
|
| Back to top |
|
 |
Noble Bell
Joined: 08 Aug 2007 Posts: 2
|
Posted: Tue Jan 29, 2008 4:48 pm Post subject: Re: Picture Box oddities |
|
|
Right you are. Darn, I forgot about the conversion to bitmap first.
--
Noble D. Bell
www.noblesoftware.com
"" wrote:
> 800x600 is a lot more than just a few k smaller than 1600x1200. Let's
> assume the image is only 16bpp color depth (and it could be 24).
>
> 800x600 = 240,000 pixels * 2 byes per pixel = 480k bitmap;
> 1600x1200 = 1,920,000 pexels * 2 bytes per pixel = 4MB bitmap;
>
> If you have 4 of these then we're talking 16MB needed just to hold the
> bitmaps you want to show. I can see how that might cause an OOM.
>
> Remember, the PictureBox can't "display" a raw JPG, it has to be
> uncompressed to a bitmap to be shipped to GDI and displayed. That's not a
> "managed" thing either, this is the case for any image created under any
> environment and really under any OS (unless there is a hardware decoder
> somewhere in the pipeline, but that's outside the scope of what we're
> talking about here).
>
>
> --
>
> Chris Tacke, eMVP
> Join the Embedded Developer Community
> http://community.opennetcf.com
>
>
>
> "Noble Bell" wrote in message
> @microsoft.com...
> >I have an app with 4 picture box controls on it and I need to load images
> > into the picture boxes. I have the picture boxes set to 216,162 in size
> > and
> > the property set to "Stretch Image". While loading image sizes of 800x600
> > there is not a problem but when I try to load an image size that is
> > 166x1200
> > everything blows up and tells me it is throwing an out of memory error.
> > How
> > can this be when the 800x600 image is only a few "k" smaller in size than
> > the
> > 1600x1200 image?
> >
> > Thanks in advance,
> >
> > --
> > Noble D. Bell
> > www.noblesoftware.com
> >
>
>
>
|
|
| Back to top |
|
 |
|
|
| Related Topics: | picture resizing I cannot get this to work I have xp Pro installed I have downloaded powertoys image reducer I have run the fix I read about none of these things works I use outlook express but not only that the image resizer is supposed to allow you to create a clone of
Picture in CrystalReport Hello, how can I insert picture into report, which I use on my WEB application. When user load my aspx page, then picture doesn't exist. Thanks
Transparent picture to Clipboard! Dear all, Is there a way to copy the transparent to Clipboard using GDI+? It seems like the and GetDataObject can only transfer bitmap. JR
Storing a picture into a database Hello, I have a problem storing a picture into a database. In the database I have a blob field, but how can I bulid a sql-command, that writes data into it? Christian
wse and compact framework Before wasting too much time, I would like to know if I can use WSE 2 on the Compact Framework. Are there any issues ? Are there articles on the web that deal with this subject ? Thanks in advance |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|