How to show bitmap image on Verifone VX 520 screen
Asked Answered
D

1

5

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?

Depress answered 6/6, 2015 at 16:31 Comment(1)
what is errno set to?Zebrass
Z
12

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

Zebrass answered 8/6, 2015 at 20:51 Comment(2)
what's difference between CHARACTER_MODE and PIXEL_MODE ?Depress
All I know is that APIs that deal with manipulating raw pixels require PIXEL_MODE and APIs that manipulate the screen using ASCII characters require CHARACTER_MODE. I'm going to guess that APIs that don't interact with the console don't care which mode you're in, but I have never experimented with it. What I can say for sure is that CHARACTER_MODE is the default and works for the vast majority of calls. I'm sorry that that's the best answer I have...Zebrass

© 2022 - 2024 — McMap. All rights reserved.