MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Picture Box oddities

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> Compact Framework
Author Message
Noble Bell



Joined: 08 Aug 2007
Posts: 2

PostPosted: Tue Jan 29, 2008 3:32 pm    Post subject: Picture Box oddities Reply with quote

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
View user's profile Send private message
user



Joined: 08 Aug 2007
Posts: 286

PostPosted: Tue Jan 29, 2008 5:40 pm    Post subject: Re: Picture Box oddities Reply with quote

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
View user's profile Send private message
Noble Bell



Joined: 08 Aug 2007
Posts: 2

PostPosted: Tue Jan 29, 2008 4:48 pm    Post subject: Re: Picture Box oddities Reply with quote

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
View user's profile Send private message
Display posts from previous:   
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
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> Compact Framework All times are GMT
Page 1 of 1

 
Jump to:  
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