I am catching some real time snaps from camera which is connected through com port. I am able to interact with camera and getting data using camera api. Thing is that I need to display image in picture box. The image information I am getting comes in a string variable. Definitly that string contains binary data ( unreadable).
I don't know how to convert this string to image. Once this binary string is converted then it will be easy to display in picture box.
Can anybody tell me, how can I convert this binary string to image file...???
Do you know the exact format of the data being retrieved? The native image classes are very picky that you use well-formed image data, and a string is generally not well formed image data.
Last edited by Craig Gemmill; March 10th, 2006 at 03:04 PM.
Reason: Wording.
Good Luck, Craig - CRG IT Solutions - Microsoft Gold Partner
-My posts after 08/2015 = .NET 4.x and Visual Studio 2015
-My posts after 11/2011 = .NET 4.x and Visual Studio 2012
-My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
-My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
-My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
-My posts before 04/2007 = .NET 1.1/2.0 *I do not follow all threads, so if you have a secondary question, message me.
The data is in unreadable format. As Unmanaged Structure I am using is to hold image data from camera that is why I suppose that it is image data. The actual structure member (written in VC++) returns void* data. As I am using it from VB.NET, it is providing me in the format of string.... But data is totally unreadable.
Yeah, see the problem is that if you don't know the data format, you can't really do anything with that data (unless you guess obviously). So, do you know if it's JPEG, BMP, RAW, TIFF, etc.?
Better yet, can you take a picture using the smallest resolution possible, then paste the contents of the string value to a text file, zip it, and post it here?
Good Luck, Craig - CRG IT Solutions - Microsoft Gold Partner
-My posts after 08/2015 = .NET 4.x and Visual Studio 2015
-My posts after 11/2011 = .NET 4.x and Visual Studio 2012
-My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
-My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
-My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
-My posts before 04/2007 = .NET 1.1/2.0 *I do not follow all threads, so if you have a secondary question, message me.
I have saved that string in txt file and file is attached here named 112.txt. Please have a look at it. Thing is that the liberary i am using supports bmp and tiff format. So it could be one of them.
I forgot to ask you, you mentioned that the image data is a structure member. Are there any more member in that structure?
Good Luck, Craig - CRG IT Solutions - Microsoft Gold Partner
-My posts after 08/2015 = .NET 4.x and Visual Studio 2015
-My posts after 11/2011 = .NET 4.x and Visual Studio 2012
-My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
-My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
-My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
-My posts before 04/2007 = .NET 1.1/2.0 *I do not follow all threads, so if you have a secondary question, message me.
Public Structure TDICLibImageInformation
Public data As String
Public dataLength As Integer
Public width As Integer
Public height As Integer
Public pixelSize As Integer
Public pitch As Integer
Public roiX0 As Integer
Public roiX1 As Integer
Public pixelType As integer
End Structure
Do you have any documentation on the data you are receiving?
Good Luck, Craig - CRG IT Solutions - Microsoft Gold Partner
-My posts after 08/2015 = .NET 4.x and Visual Studio 2015
-My posts after 11/2011 = .NET 4.x and Visual Studio 2012
-My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
-My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
-My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
-My posts before 04/2007 = .NET 1.1/2.0 *I do not follow all threads, so if you have a secondary question, message me.
Ok... look, we need all the info you have. We have no idea what you are working with here, so if you have more information, it will only help us help you. Otherwise we are wildy guessing.
What are the rest of the values of the members in that structure?
Again, any documentation?
Good Luck, Craig - CRG IT Solutions - Microsoft Gold Partner
-My posts after 08/2015 = .NET 4.x and Visual Studio 2015
-My posts after 11/2011 = .NET 4.x and Visual Studio 2012
-My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
-My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
-My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
-My posts before 04/2007 = .NET 1.1/2.0 *I do not follow all threads, so if you have a secondary question, message me.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.