斑竹:运行例程出错的问题可以解决吗?
情况是这样:运行jawbreaker:/mnt/egui/bin # ./jawbreaker
New windows id = 3
Open file error r.jpg
/mnt/egui/bin #
## 这是程序打印出来的信息,说明出错了。VGA没有显示出图案。为什么会是这样的?
运行monitor:
/mnt/egui/bin # ./monitor
New windows id = 3
## VGA显示出正确的图案。
显示JPEG图片:运行viewjpeg:
./viewjpeg w.jpg >>/dev/null &
/mnt/egui/bin #
### VGA显示图片框但没有图片,为什么会是这样?
再用如下方式运行:
/mnt/EGui/bin # ./viewjpegw.jpg
New windows id = 1
Egui ERROR:x = 133 x1 = 231 y = 745 y1 = 763,someone too big.
Egui ERROR:x = 135 x1 = 230 y = 747 y1 = 762,someone too big.
Egui ERROR:x = 23 x1 = 121 y = 745 y1 = 763,someone too big.
Egui ERROR:x = 25 x1 = 120 y = 747 y1 = 762,someone too big.
### VGA显示图片框但没有图片,为什么会是这样?
运行fifteen:
./fifteen >>/dev/null &
Done(1) ./jawbreaker 1>>/dev/null
/mnt/egui/bin #
## VGA显示出正确的图案。
但运行脚本文件run-egui.sh:
/mnt/egui/bin # ./run-egui.sh
/mnt/egui/bin #
##VGA没有图片输出,提示信息为:
Open ok ....
EGui release ....
## 为什么会是这样? 咱们一个一个解决问题
./jawbreaker
New windows id = 3
Open file error r.jpg
你查找r.jpg有问题吗?用display r.jpg看看。 用display r.jpg可以看到 small red ball . 提示r.jpg找不到?这个不应该阿,就是一个open函数而已。你再看看jawbreaker代码,我这里没有出现过。
问题解决了!
我把VGA配成800*600或者1024*768之后,运行就正常了。但编译程序时,还是提示zlib找不到,只有通过先编译zlib-1.2.3,然后放把zlib copy到LIB中才可以。想不明白。我用的是ARM9平台。 1.zlib 可能和编译选项有关系。我需要查找一下。我这里没有问题。2. 你以前VGA配置是多少?不是800*600或者1024*768?
我这里测试过480x272都没有问题。 又有遇到新问题!!
例程我是留在PC上的, 通过开发板挂载到PC上去运行例程。以前我的VGA配置是600*480,就一直不能打开,
后有我配成800*600 或 1024*768就正常备了。
但现在发现显示JPG图片颜色不对,红色小球显示出来的是偏向淡黄色,我开发板framebuf配置是16bpp。是不是颜色转换不对??bmp图片颜色对的. 16bpp以前我测试没有问题.你能贴一个图片看看?
在EGui下怎么截图呢?
1.
capturebmp *.bmp 可以将当前屏幕保存为*.bmp图片.
2.在 window下使用MS的画图 另存为 *.jpg就可以了. 我把egui下的截图及原图发给你邮箱了,请查收! 没有收到,请发送到[email protected] E-mail已发给你了,请查收! 你的图片我看了,egui不应该这样.
jpg,显示你用什么程序做的? viewjpg? 我是在jawbreaker 例程中修改的.其实Jawbreaker原码显示小球颜色也是不对的.
以下我帖出部分我修改有代码.
int main(int argc, char **argv)
{
char * rgbbuf;
int width,height;
Ecolor * bgcolor,color;
int w,h;
EGui_Window * ewindow;
EGui_Widget * form;
EGui_Widget * win;
EGui_Widget * edit;
int pictureStartX,pictureStartY,pictureWith,pictureHigh;
if (Egui_open (&Efbinfo))
return ;
bgcolor = malloc (sizeof ( Ecolor));
if (bgcolor == NULL)
{
printf ("malloc color ERROR\n");
return -1;
}
bgcolor->r = bgcolor->g = bgcolor->b = 0xcc;
/* create window will initial color's pixel.
*/
ewindow = Egui_CreateWindow(&Efbinfo,0,0,800,700,bgcolor,EGUI_WINDOW_TOP);
if (ewindow == NULL)
{
printf ("New windows failed\n");
Egui_close ();
return 1;
}
Egui_SetWindowName(ewindow,"Jawbreaker");
Egui_drawwindow(ewindow);
win = new_widget_window(ewindow);
widget_show(win);
form = new_form (win);
widget_show (form);
/* init position */
// init_pos ();
/* random map */
//random_map ();
// if (!init_pixmap(ewindow))
// return 1;
if (get_pixmap_form_file (argv,&Pixmap_buf,ewindow)==0)
{
printf("open user jpg error\n");
Egui_close ();
return 1;
}
// get_pixmap_form_file(argv,&Pixmap_buf,ewindow);
//map_pixmap(form);
pictureStartX=400;
pictureStartY=400;
pictureWith=300;
pictureHigh=200;
pixmap_tmp_buf= new_pixmap (form,pictureStartX,pictureStartY,pictureWith,pictureHigh);//make a picture form
pixmap_set (pixmap_tmp_buf,&Pixmap_buf);
widget_show(pixmap_tmp_buf);
// memset(col_kill,0,COL);
button_win = new_button (form,20,220,100,20);
widget_set_name(button_win,"New Start");
widget_show(button_win);
widget_register_callback (button_win, BUTTON_REL_LEFT,button_win_click);
button_mark = new_button (form,130,220,100,20);
widget_set_name(button_mark,"0");
widget_show(button_mark);
edit = new_edit(form,240,220,100,20);
widget_show(edit);
widget_draw (win);
/* after form draw line */
// init_background (form,ewindow); // draw line for form
Egui_loop ();
Egui_CloseWindow (ewindow);
free (bgcolor);
Egui_close ();
} 1.
你用fbset查看你的framebuffer 的配置看是不是8位色.
我这里显示小球颜色没有问题.
2. 你framebuffer 改为24位色看看. 我把运行jawbreaker 时capture的图片发给你了。请查收!
使用fbset 查看的信息如下:
A 24 bits BMP display program for Egui
usage : ./bmp filename
/testdir/EGui/bin # fbset
mode "800x600-72"
# D: 48.001 MHz, H: 45.455 kHz, V: 72.381 Hz
geometry 800 600 800 600 16
timings 20833 88 40 23 1 128 4
accel false
rgba 5/11,6/5,5/0,0/0
endmode
我的板子底层驱动不支持24BIT的,现在只有16BIT的配置。
页:
[1]
2