|
|
|
date: Thu, 7 Aug 2008 11:55:01 -0700,
group: microsoft.public.vstudio.development
back
Re: SlideShow "*.jpg" files developing in C# "OutOfMemoryException
"tmoraes" wrote in message
news:D4856722-ABBE-4B76-A6C8-DB54A6F534D5@microsoft.com...
> So,
> You have another solution for me?
> What can i do about it?
More memory or smaller images....that's all I can think of.
I don't know anything about pocket PCs, sorry.
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
>
> Thanks
> Thiago
>
> "Mark Salsbery [MVP]" wrote:
>
>> "tmoraes" wrote in message
>> news:6319605A-3552-4AE1-BBD9-09DD443A5E98@microsoft.com...
>> > 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" wrote in message
>> >> news:990E7B4C-DC10-49AA-992B-BFBF4505A967@microsoft.com...
>> >> > 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
>> >>
>> >>
>>
date: Fri, 8 Aug 2008 12:59:28 -0700
author: Mark Salsbery [MVP] MarkSalsbery[MVP]@newsgroup.nospam
|
|