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, December 6, 2006 11:46:45 AM(UTC)

russw  
russw

Groups: Registered
Posts: 2


I have a project where I have to display an image that is extracted from within an xml file. Can someone explain how I can load the string into a rasterimageviewer. What I am doing currently is wrting the image to a file then loading that file which is obviously not very efficient, my current code is below

Dim BitmapData() As Byte
BitmapData = Convert.FromBase64String(imageText)
Dim streamBitmap As MemoryStream = New System.IO.MemoryStream(BitmapData)
Dim bitImage As Image = Image.FromStream(streamBitmap)

'write image
bitImage.Save("label.png")

' Load an image into the viewer
Dim codecs As New RasterCodecs
RasterImageViewer1.Image = codecs.Load("label.png")

Thanks
 

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, December 6, 2006 11:34:13 PM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

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

One you get the data into a MemoryStream, you don't need to save it to
disk.  Just call one of the overloads of the RasterCodecs.Load method that takes a Stream and load it directly.

 
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.057 seconds.