mainrotor
asked on
I need help viewing multiple page TIFF image in my WPF with VB.Net code-behind application
Hi Experts,
I have a SQL table with a field that stores binary data. The binary data is of "muliple page TIFF" image\file.
I want to display this multiple page Tiff image\file in my WPF application, using a scroll viewer, a viewbox, and image controls.
How can I do this?
I need both XAML and VB.Net code-behind samples.
Thank you,
I have a SQL table with a field that stores binary data. The binary data is of "muliple page TIFF" image\file.
I want to display this multiple page Tiff image\file in my WPF application, using a scroll viewer, a viewbox, and image controls.
How can I do this?
I need both XAML and VB.Net code-behind samples.
Thank you,
ASKER
darbid73. Thank you for your suggestions. I will definitely check them all out.
Yes, I do want to know how to do it myself.
Thanks.
mrotor
Yes, I do want to know how to do it myself.
Thanks.
mrotor
ASKER
darbid73 and other experts,
I got the following code to work using TiffBitMapDecoder. This works great when your file exists in a file path (like in my test code below):
My problem is that my tiff images files do not exist in a file path. They are saved as binary code in a SQL Server table (see example of binary code below). How can I get this binary code to work with TiffBitMapDecoder in order to get the frame count?
TEST CODE
SAMPLE OF BINARY DATA
Thanks in advance,
mrotor
I got the following code to work using TiffBitMapDecoder. This works great when your file exists in a file path (like in my test code below):
My problem is that my tiff images files do not exist in a file path. They are saved as binary code in a SQL Server table (see example of binary code below). How can I get this binary code to work with TiffBitMapDecoder in order to get the frame count?
TEST CODE
Dim imageStreamSource As New FileStream("C:\MyFiles\LETTER_A_EXAMPLE_XYZ.tif", FileMode.Open)
Dim decoder As New TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)
Dim bitmapSource As BitmapSource = decoder.Frames(0)
SVimage1.Source = bitmapSource
SAMPLE OF BINARY DATA
Thanks in advance,
mrotor
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
dsuyemoto,
I will try passing a stream and post my results.
thank you,
mrotor
I will try passing a stream and post my results.
thank you,
mrotor
Not really sure that accepted solution is the answer to your question mate.
Your question is a fairly large one to answer. Could you be a little more specific with what you are having difficulty with?
I will assume you want to write it all yourself, if however I am incorrect;
Here is a complete Example with RadControls from Telerik and another example from RasterEdge.
So now doing it yourself.
I believe that you will need to use the TiffBitmapDecoder to do this the best way.
This is also the common way to go in other forums and in this question here too.