I am converting one of my visual basic6 program to xojo and stuck on this concern.
What is the corresponding conversion of VisualBasic 6 “RawImage” to XOJO?
I attached the usage of RawImage and its value to give you Idea.
I hope somebody can help me on this.
looks to me like raw pixel values.
You may be able to write them in two loops into a RGBSurface.
Is that maybe 355 x 130 Pixel and RGB?
Providing the VB LR explanation would help to understand what RawImage can be translated to in Xojo
the data bytes come from a digital persona fingerprint biometric (after I scan my finger).
Raw data files are often vendor specific. Maybe the GDI+ Lib can help you by using declares.
However, if you will noticed from the screenshot above, the byte is translated to picture. Maybe there is a method in XOJO that can translate byte to picture so that it can display in the imagewell.
Maybe this works (on top of my head):
- convert the byte data to String type
- place a Canvas on a Window
- create a new Picture with the Canvas dimensions (
Pic = New Picture(MainWindow.Canvas1.Width,MainWindow.Canvas1.Height,32))
- create a MemoryBlock
- read the String into the MemoryBlock
- convert the MemoryBlock data into the new Picture (
Pic = Picture.FromData(MB))
Canvas1.Backdrop = Pic
Unlikely as it is raw data.
As said best put bytes into RGBSurface.
Hi Chris and Alex,
Maybe you can share some thoughts on this.
In VB6 values are in the form of ARRAY and its value was defined as integer.
In XOJO, everything looks different.
Im stuck on how to access the value of each element so that I can try both your solutions. Please help.
Could you send it in a PM? I’ll have a look.
If its just a bunch of bytes representing the grey scale values then this should work (as Christian mentions above), but without a test image this is just a guess, feel free to PM me the image if this doesn’t work.
Thanks for the Idea Julian.
Unfortunately, the picture that has to be shown on a imagewell is currently sits on a object called rawImage_param which is shown below.
Got a hard time searching from forum on how to get individual values (rawImage_param ) so that I can apply it from the sample code you sent.
Do you call GrCapRawImageToHandle to get back a handle to a HBITMAP if not how to you populate rawImage_param with the data, are you getting a pointer to the data from the ImageCallback?
Could I ask you to make a rawImage file that says something like “Hello World” and post it for a few of us to download and determine the structure of the image for you? Like Julian mentioned, without an example image, its really difficult to determine the format to convert the image.
I don’t want data from a picture of your fingerprint, since this is personal data
" how to you populate rawImage_param with the data" - After I touch the Finger print scanner, XOJO win app captured the data and present to me the RawImage_Param as shown from the photo.
My problem now is, how to extract it to form as binary stream or memoryblock.
"Could I ask you to make a rawImage file " - Actually, that’s my problem. there is no image available yet. The finger print scanner just return value in RawImage_param which I dont know how to extract it to create a photo.
If you put the following in your code, what do you see on the debug output:
How many rows are there in the data?
What is the width and height of the image from the data shown above or is there nothing to indicate that?
Who wrote your Xojo win app, do you have access to the source code of it?