[英]How to show animation in verifone vx520?
I want to show animation in verifone vx520. 我想在verifone vx520中显示动画。 Here is my code but it doesn't show anything on the screen.
这是我的代码,但它没有在屏幕上显示任何内容。 How should I my initialize my bitmapped file to this function?
我应该如何将我的位图文件初始化为此函数? How can I use and animate
animationbmp
? 我如何使用动画
animationbmp
和animationbmp
?
#define RGB2PIXEL565(r,g,b) \
((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3))
void animate(void) {
char animationbmp[]="move.bmp"
int con;
short * frameBuffer;
frameBuffer=(short*)malloc(8);
con = open (DEV_CONSOLE, 0);
frameBuffer[0]= RGB2PIXEL565 (0xFF, 0, 0 ); // red
frameBuffer[1]= RGB2PIXEL565 (0, 0xFF, 0 ); // green
frameBuffer[2]= RGB2PIXEL565 (0, 0, 0xFF); // blue
frameBuffer[3]= RGB2PIXEL565 (0xFF, 0, 0xFF); // purple
set_display_coordinate_mode (PIXEL_MODE);
display_frame_buffer(0,0,4,1,frameBuffer);
display_frame_buffer(1,2,2,2,frameBuffer);
display_frame_buffer(5,1,1,4,frameBuffer);
}
I don't know exactly if Verifone Vx520 can show animation files, but the easiest way to display animation is to periodically change pictures. 我不确切知道Verifone Vx520是否可以显示动画文件,但显示动画的最简单方法是定期更改图片。 Here are an example of code:
以下是代码示例:
void animation(char *file1, char *file2, int x, int y){
set_display_coordinate_mode(PIXEL_MODE);
put_BMP_at(x,y, (char *)file1); //Draw image on a display starting from pos (x;y)
SVC_WAIT(some_pause_in_msec); //system function like "sleep"
put_BMP_at(x,y, (char *)file2); //Draw image on a display
SVC_WAIT(some_pause_in_msec);
set_display_coordinate_mode(CHARACTER_MODE); //Back to text display mode (optional)
}
About how to work with image files (".BMP") you can read here . 关于如何使用图像文件(“.BMP”),您可以在这里阅读。 Your files must be black-white ".bmp" files for Vx520.
您的文件必须是Vx520的黑白“.bmp”文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.