Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, February 15, 2012 5:59:08 AM(UTC)

madss  
madss

Groups: Registered
Posts: 5


Is there an example of how to LoadImage from a MemoryStream rather than an actual image file? I'm developing with vb.net.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, February 15, 2012 6:18:23 AM(UTC)

JamesD  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Take a look at this tutorial in the help:
http://www.leadtools.com/help/leadtools/v175/dh/to/leadtools.topics~leadtools.topics.loadinganimagefromabuffer.html
It has example code in VB and C#
 
#3 Posted : Wednesday, February 15, 2012 10:13:32 AM(UTC)

madss  
madss

Groups: Registered
Posts: 5


This seemd to make sense, but I get an Invalid File Format error. I'm confused becuse codecs.Load(xx) is looking for a filename and I (and your example) is passing the image as bytes.
 
#4 Posted : Wednesday, February 15, 2012 10:17:06 AM(UTC)

JamesD  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

codecs.Load has overloaded methods for accepting filenames as well as memory stream objects.
 
#5 Posted : Wednesday, February 15, 2012 10:56:36 AM(UTC)

madss  
madss

Groups: Registered
Posts: 5


OK, that makes sense. So is there a direction you can point me in regarding the InvalidFileFormat error. I am using the same stream to write a .jpg file and populate an imagebox w/o a problem. Thanks.
 
#6 Posted : Thursday, February 16, 2012 4:05:30 AM(UTC)

JamesD  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

In the DotNet libraries, Invalid File Format means one of three things: 1.) The file is actually invalid or there's a problem with the codec. If you can load the same file in one of our pre-compiled demos that ship with the toolkit, then this is not the case. 2.) You did not call RasterCodecs.StartUp() (Only required for versions previous to V17). 3.) You are not including as a reference or copying to your .exe's directory the necessary codecs dll for the file format. These dlls follow the naming convention of Leadtools.Codecs.???.dll (e.g. Leadtools.Codecs.Tif.dll). To learn which dlls are necessary for a particular file format, please read the help file article "Files to be Included With Your Application" and find the row for the file format in question.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.184 seconds.