Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone! i am new to WPF and i need to integrate a legacy system with a new wpf system. the legacy system reads a multipage .tif document into an array of strings each representing a single .tif image/page. i have to take the string array and loop through it converting each string to either .tif file or a bitmap. can anyone help me on that please. thanks in advance.
Posted

1 solution

You can use the class System.Drawing.Bitmap and read the bitmap from stream: http://msdn.microsoft.com/en-us/library/z7ha67kw%28v=vs.110%29.aspx[^].

Now, what stream? It could be a memory stream: http://msdn.microsoft.com/en-us/library/system.io.memorystream%28v=vs.110%29.aspx[^].

I don't know how exactly the data bytes are represented in your string, so first, you need to convert your string to byte[] data. It could be just some 8-bit encoding where each character is 8-bit and represents a single byte, then you would need to copy such characters into bytes with a case. In general more case, the System.Text.Encoding classes are responsible for getting data from a string:
http://msdn.microsoft.com/en-us/library/ds4kkd55%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.text.encoding(v=vs.110).aspx[^].

—SA
 
Share this answer
 
Comments
shozhh 19-Feb-14 2:29am    
Thanks! that helped a lot!!!!
Sergey Alexandrovich Kryukov 19-Feb-14 2:40am    
You are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900