LEADTOOLS Support
Imaging
Imaging SDK Questions
Loading image string into rasterimageviewer
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, December 6, 2006 11:46:45 AM(UTC)
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
#2
Posted
:
Wednesday, December 6, 2006 11:34:13 PM(UTC)
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.
LEADTOOLS Support
Imaging
Imaging SDK Questions
Loading image string into rasterimageviewer
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.