rawImages of VB6 to XOJO

Hi Guys,

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…

Hi Chris,

the data bytes come from a digital persona fingerprint biometric (after I scan my finger).

Any idea?

Raw data files are often vendor specific. Maybe the GDI+ Lib can help you by using declares.

Thank Alex,

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):

  1. convert the byte data to String type
  2. place a Canvas on a Window
  3. create a new Picture with the Canvas dimensions (Pic = New Picture(MainWindow.Canvas1.Width,MainWindow.Canvas1.Height,32))
  4. create a MemoryBlock
  5. read the String into the MemoryBlock
  6. convert the MemoryBlock data into the new Picture (Pic = Picture.FromData(MB))
  7. 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.

pm sent

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.

Any idea?

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?

Hi Ronaldo,

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 :slight_smile:

HI Julian,

" 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.

HI Eugine,

"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:

system.DebugLog(str(rawImage_Param(0))) system.DebugLog(encodehex(str(rawImage_Param(0))))

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?

Hi Julian,

for your questions:

  1. A total of 138,430 (index of 0) as shown from the screenshot

  2. Height = 390, Width 355. This was also returned by fingerprint event. See picture below

  3. It was written on Visual Basic 6 before and I am converting it to Xojo Desktop.