[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Out of memory when using FromFile method

MarcR

10/19/2004 4:45:00 PM

I have two JPG in a directory. Both are pictures from digital cameras (but
not the same camerat). I use the following code to load the image:

dim objImage as system.drawing.image
dim sFile as string
objImage = objImage.FromFile(sFile)

When sfile is set to c:\a.jpg, I have no problem, howerver when it is set to
use c:\b.jpg it throws an out of memory error. I know that it is related to
the JPG file, but cannot figure out how to deal with it.

The b.jpg file opens fine in paint and image editor under windows. Both
files are <100k.


Any thoughts on this problem would be helpful.

Thanks,
Marc.
rivsoftinc-a@yahoo.ca
3 Answers

Bob Powell

10/19/2004 11:35:00 PM

0

It'd be useful if you could post the b image as an attachment to this thread
please.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdipl...

The GDI+ FAQ RSS feed: http://www.bobpowell.net/f...
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tips...
Bob's Blog: http://bobpowelldotnet.blogspot.co...






"MarcR" <MarcR@discussions.microsoft.com> wrote in message
news:8A288D0C-2BF0-4D41-8A5B-D1A4F3EA06F1@microsoft.com...
> I have two JPG in a directory. Both are pictures from digital cameras
(but
> not the same camerat). I use the following code to load the image:
>
> dim objImage as system.drawing.image
> dim sFile as string
> objImage = objImage.FromFile(sFile)
>
> When sfile is set to c:\a.jpg, I have no problem, howerver when it is set
to
> use c:\b.jpg it throws an out of memory error. I know that it is related
to
> the JPG file, but cannot figure out how to deal with it.
>
> The b.jpg file opens fine in paint and image editor under windows. Both
> files are <100k.
>
>
> Any thoughts on this problem would be helpful.
>
> Thanks,
> Marc.
> rivsoftinc-a@yahoo.ca


MarcR

10/20/2004 10:51:00 AM

0

Hmm. The most interesting problem...I was on my notebook to do some of this
development, but when I went to send you a sample photo tonight, I was on my
desktop and everything is working. I thought the problem was related to the
image, but is it possible there is something else at work? Would having
photoshop on my machine make any sort of difference? I was unable to post
the picture.

Thanks,
Marc.

"Bob Powell [MVP]" wrote:

> It'd be useful if you could post the b image as an attachment to this thread
> please.
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/gdipl...
>
> The GDI+ FAQ RSS feed: http://www.bobpowell.net/f...
> Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tips...
> Bob's Blog: http://bobpowelldotnet.blogspot.co...
>
>
>
>
>
>
> "MarcR" <MarcR@discussions.microsoft.com> wrote in message
> news:8A288D0C-2BF0-4D41-8A5B-D1A4F3EA06F1@microsoft.com...
> > I have two JPG in a directory. Both are pictures from digital cameras
> (but
> > not the same camerat). I use the following code to load the image:
> >
> > dim objImage as system.drawing.image
> > dim sFile as string
> > objImage = objImage.FromFile(sFile)
> >
> > When sfile is set to c:\a.jpg, I have no problem, howerver when it is set
> to
> > use c:\b.jpg it throws an out of memory error. I know that it is related
> to
> > the JPG file, but cannot figure out how to deal with it.
> >
> > The b.jpg file opens fine in paint and image editor under windows. Both
> > files are <100k.
> >
> >
> > Any thoughts on this problem would be helpful.
> >
> > Thanks,
> > Marc.
> > rivsoftinc-a@yahoo.ca
>
>
>

Bob Powell

10/20/2004 1:58:00 PM

0

Sorry, what I know about Photoshop you can write on the back of a postage
stamp along with most of the New York phone directory ;-)

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdipl...

The GDI+ FAQ RSS feed: http://www.bobpowell.net/f...
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tips...
Bob's Blog: http://bobpowelldotnet.blogspot.co...






"MarcR" <rivsoftinc-a@yahoo.ca> wrote in message
news:AF5D1018-FEF3-4751-9D9C-98F44238EEA8@microsoft.com...
> Hmm. The most interesting problem...I was on my notebook to do some of
this
> development, but when I went to send you a sample photo tonight, I was on
my
> desktop and everything is working. I thought the problem was related to
the
> image, but is it possible there is something else at work? Would having
> photoshop on my machine make any sort of difference? I was unable to post
> the picture.
>
> Thanks,
> Marc.
>
> "Bob Powell [MVP]" wrote:
>
> > It'd be useful if you could post the b image as an attachment to this
thread
> > please.
> >
> > --
> > Bob Powell [MVP]
> > Visual C#, System.Drawing
> >
> > Answer those GDI+ questions with the GDI+ FAQ
> > http://www.bobpowell.net/gdipl...
> >
> > The GDI+ FAQ RSS feed: http://www.bobpowell.net/f...
> > Windows Forms Tips and Tricks RSS:
http://www.bobpowell.net/tips...
> > Bob's Blog: http://bobpowelldotnet.blogspot.co...
> >
> >
> >
> >
> >
> >
> > "MarcR" <MarcR@discussions.microsoft.com> wrote in message
> > news:8A288D0C-2BF0-4D41-8A5B-D1A4F3EA06F1@microsoft.com...
> > > I have two JPG in a directory. Both are pictures from digital cameras
> > (but
> > > not the same camerat). I use the following code to load the image:
> > >
> > > dim objImage as system.drawing.image
> > > dim sFile as string
> > > objImage = objImage.FromFile(sFile)
> > >
> > > When sfile is set to c:\a.jpg, I have no problem, howerver when it is
set
> > to
> > > use c:\b.jpg it throws an out of memory error. I know that it is
related
> > to
> > > the JPG file, but cannot figure out how to deal with it.
> > >
> > > The b.jpg file opens fine in paint and image editor under windows.
Both
> > > files are <100k.
> > >
> > >
> > > Any thoughts on this problem would be helpful.
> > >
> > > Thanks,
> > > Marc.
> > > rivsoftinc-a@yahoo.ca
> >
> >
> >