point-of-saleverifone

How to show bitmap image on Verifone VX 520 screen


I'm trying to show a bitmap image on a Verifone VX 520 screen.

I tried using the put_BMP() function but it returns -1 and the image doesn't show. The image is monochrome and 128x128 pixels. Here is the code:

int main() {
  char bg[] = "background.bmp";
  int display = open(DEV_CONSOLE, O_WRONLY);
  put_BMP(bg);
  return 0;
}

How do I accomplish this?


Solution

  • Here are some things to check:

    1) "[put_BMP()] is available only in pixel mode." To put the terminal into pixel mode, you call set_display_coordinate_mode(PIXEL_MODE); Don't forget to put it back by calling set_display_coordinate_mode(CHARACTER_MODE); when you are done.

    2) "The file must be uncompressed."

    3) "The file must be monochrome or 4-level gray." (I see you are doing this)

    4) "The file should be 128 pixels wide and either 64 pixels high (Vx510, 570, 610) or 128 pixels high (Vx 670)." Note that 520 is not on this list, however the 520 and the 570 are very similar in many ways and the screen size is one of them. If you use a pic that is 128 pixels high, you'll only see the top 1/2 of it.

    5) Also, don't forget to copy the file to the terminal--I do that more often than I care to admit.

    The following code:

    set_display_coordinate_mode(PIXEL_MODE);
    put_BMP("StackOverflow.bmp");
    set_display_coordinate_mode(CHARACTER_MODE);
    

    uses a logo that is 128 x 64 pixels and results in:

    put_BMP result