rawImages of VB6 to XOJO

  1. 4 months ago

    ronaldo f

    Jun 30 Pre-Release Testers, Xojo Pro Philippines

    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.

    -image-
    -image-

  2. Christian S

    Jun 30 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    looks to me like raw pixel values.
    You may be able to write them in two loops into a RGBSurface.

  3. Christian S

    Jun 30 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    Is that maybe 355 x 130 Pixel and RGB?

  4. Emile S

    Jun 30 Europe (France, Strasbourg)

    Providing the VB LR explanation would help to understand what RawImage can be translated to in Xojo…

  5. ronaldo f

    Jun 30 Pre-Release Testers, Xojo Pro Philippines

    Hi Chris,

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

    -image-

    Any idea?

  6. Alexander v

    Jun 30 Europe (Houten, The Netherland...

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

  7. ronaldo f

    Jun 30 Pre-Release Testers, Xojo Pro Philippines

    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.

  8. Alexander v

    Jun 30 Europe (Houten, The Netherland...
    Edited 4 months ago

    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
  9. Christian S

    Jun 30 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    Unlikely as it is raw data.

    As said best put bytes into RGBSurface.

  10. ronaldo f

    Jun 30 Pre-Release Testers, Xojo Pro Philippines

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

    In XOJO, everything looks different.
    -image-

    Im stuck on how to access the value of each element so that I can try both your solutions. Please help.

  11. Alexander v

    Jun 30 Europe (Houten, The Netherland...
    Edited 4 months ago

    Could you send it in a PM? I'll have a look.

  12. ronaldo f

    Jun 30 Pre-Release Testers, Xojo Pro Philippines

    pm sent

  13. Julian S

    Jun 30 Pre-Release Testers, Xojo Pro UK
    Edited 4 months ago

    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.

    https://www.dropbox.com/s/hopb5jjbt38jtqe/ReadRAWImage.xojo_binary_project?dl=0

  14. ronaldo f

    Jun 30 Pre-Release Testers, Xojo Pro Philippines

    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.

    -image-

    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?

  15. Julian S

    Jun 30 Pre-Release Testers, Xojo Pro UK
    Edited 4 months ago

    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?

  16. Eugene D

    Jun 30 Pre-Release Testers, Xojo Pro Canada scispec.ca

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

  17. ronaldo f

    Jun 30 Pre-Release Testers, Xojo Pro Philippines

    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.

    -image-

    My problem now is, how to extract it to form as binary stream or memoryblock.

  18. ronaldo f

    Jun 30 Pre-Release Testers, Xojo Pro Philippines

    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.

  19. Julian S

    Jun 30 Pre-Release Testers, Xojo Pro UK
    Edited 4 months ago

    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?

  20. ronaldo f

    Jul 1 Pre-Release Testers, Xojo Pro Philippines

    Hi Julian,

    for your questions:
    1. A total of 138,430 (index of 0) as shown from the screenshot
    -image-

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

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

  21. Newer ›

or Sign Up to reply!