Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"tmoraes" <tmoraes@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:6319605A-3552-4AE1-BBD9-09DD443A5E98@xxxxxxxxxxxxxxxx
It´s a good idea,
Idid this but....
The problem still hapen,
I think that i´ll need resize my images to lower resolution before Show it.
But I don´t know how...


Resizing is easy enough, but if you don't have enough memory to load a image, it's not going to work.

Mark

--
Mark Salsbery
Microsoft MVP - Visual C++



Do you know another thing what can i do?

Thanks for your time
Regards Thiago

"Mark Salsbery [MVP]" wrote:

"tmoraes" <tmoraes@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:990E7B4C-DC10-49AA-992B-BFBF4505A967@xxxxxxxxxxxxxxxx
> I´m developing a digital portrait photos for my pocket pc in C# whit > .NET
> CF
> 2.0.
> And i have a problem with memory when my board working with high
> resolution
> photos in jpg, i have a big problem because my board don´t have > graphics
> aceleration and i need to solve this problem in software.
>
> i was create an array with paths of my pictures in Storage Card.
>
> private void timer1_Tick(object sender, EventArgs e)
> {
> if (j > pathss.Length - 1)
> {
> j = 0;
> pictureBox1.Image = new Bitmap("" + pathss[j]);
> j++;
> }
> else
> {
> pictureBox1.Image = new Bitmap("" + pathss[j]);
> j++;
> }
> }
>
>
> When my board show pictures i have the following error:
>
> OutOfMemoryException
> at Microsoft.AGL.Common.MISC.HandleAr()
> at System.Drawing.Bitmap._InitFromMemoryStream()
> at System.Drawing.Bitmap..ctor()
> at PRD1.Form1timer1_Tick()
> ....
>
> I need some function that resize my pictures in my function to display > my
> photos.
>
> Anybody Could help me in my problems?


Does disposing the previous Bitmap help?

private void timer1_Tick(object sender, EventArgs e)
{
if (null != pictureBox1.Image)
pictureBox1.Image.Dispose

if (j > pathss.Length - 1)
{
j = 0;
pictureBox1.Image = new Bitmap("" + pathss[j]);
j++;
}
else
{
pictureBox1.Image = new Bitmap("" + pathss[j]);
j++;
}
}


Mark

--
Mark Salsbery
Microsoft MVP - Visual C++


>
> Thanks
> Regards.
> Thiago


.



Relevant Pages

  • Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException
    ... I think that i´ll need resize my images to lower resolution before Show ... i was create an array with paths of my pictures in Storage Card. ... Does disposing the previous Bitmap help? ...
    (microsoft.public.vstudio.development)
  • Re: Automatic Picture Sizing and Renaming
    ... | I have several hundred pictures I'd like to resize to 800x600 and I'd ... | also like to randomize their names to have them shuffle on a computer ... | I'm not sure how to get this to work on a whole directory full of pictures. ... Rename all images in said source directory to a random number ...
    (Fedora)
  • Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException
    ... I think that i´ll need resize my images to lower resolution before Show it. ... i was create an array with paths of my pictures in Storage Card. ... Does disposing the previous Bitmap help? ...
    (microsoft.public.vstudio.development)
  • Re: extra big pictures when sending an email.
    ... Then you can open any folder that contains images and you will have an option to resize. ... Just right click the selected image files and choose Resize Pictures from the menu. ... The program will place the resized copies in the folder with your originals. ...
    (microsoft.public.windowsxp.photos)
  • Re: Image Resizer Powertoy question
    ... pictures, without changing the originals. ... functionality for resizing multiple images at the same time. ... To use this PowerToy, select any image, or group of images, right-click, and ... select Resize Pictures. ...
    (microsoft.public.windowsxp.general)