Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException
- From: "Mark Salsbery [MVP]" <MarkSalsbery[MVP]@newsgroup.nospam>
- Date: Fri, 8 Aug 2008 07:11:46 -0700
"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
- Follow-Ups:
- References:
- SlideShow "*.jpg" files developing in C# "OutOfMemoryException"
- From: tmoraes
- Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException"
- From: Mark Salsbery [MVP]
- Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException
- From: tmoraes
- SlideShow "*.jpg" files developing in C# "OutOfMemoryException"
- Prev by Date: Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException
- Next by Date: Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException
- Previous by thread: Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException
- Next by thread: Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException
- Index(es):
Relevant Pages
|