qt에서 lcd 제어 관련 질문 드립니다.
qt관련 소스 입니다. 윗부분은 나름대로 프레임 버퍼를 제어 하려고 쓴부분이고.
아랫 부분은 qt로 화면에 디스 플레이 하기 위한 부분입니다.
소스를 실행 시키면 흑백 stn lcd에 화변이 까맣게 변하네요...
m_logo->setPixmap(QPixmap::fromMimeSource("/img/MAIN.BMP"));
이렇게 이미지를 올리는데 요부근에서 fb처리를 병행 해야 할듯한데 어떤게 처리 해야할지.
혹시 해서 드리는 질문인데 펭귄만 나오면 프레임 버퍼 설정은 끝났다구 생각하고 그냥 SHOW해서 보여주는거 아닌가요..??
다른 뭔가를 또 해줘야 하나요.??
//======================================================
mainform::mainform( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl=Qt::WStyle_Customize), rfthread(0), key_thread(0)
//======================================================
{
struct fb_var_screeninfo vinfo;
struct fb_fix_screeninfo finfo;
int x = 0, y = 0;
int fbfd = 0;
char *fbp = 0;
long int screensize = 0;
long int location = 0;
// Open the file for reading and writing
fbfd = open("/dev/fb0", O_RDWR);
if (!fbfd)
{
printf("Error: cannot open framebuffer device.\n");
exit(1);
}
printf("The framebuffer device was opened successfully.\n");
// Get fixed screen information
if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo))
{
printf("Error reading fixed information.\n");
exit(2);
}
// Get variable screen information
if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo))
{
printf("Error reading variable information.\n");
exit(3);
}
// Figure out the size of the screen in bytes
screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel/ 8;
// Map the device to memory
fbp = (char *)mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, fbfd, 0);
if ((int)fbp == -1)
{
printf("Error: failed to map framebuffer device to memory.\n");
exit(4);
}
printf("The framebuffer device was mapped to memory successfully.\n");
errordialog = NULL;
g_cInitStatus = 1;
M_Stack = new QWidgetStack( this);
M_Stack->setGeometry( QRect( 0, 0, 320, 240) ); // stack size
M_Stack->setMaximumSize( QSize( 320, 240 ) );
M_Stack->setFocusPolicy(NoFocus); // no focus stack, get mainformextern
m_pMainPage = new QWidget(M_Stack, "MainPage"); // main page widget
m_logo = new QLabel(m_pMainPage, "m_logo");
m_logo->setPixmap(QPixmap::fromMimeSource("/img/MAIN.BMP")); // main image display
m_logo->setFrameStyle(QFrame::Box | QFrame::Plain); // layout box
m_logo->setAlignment(AlignHCenter | AlignVCenter);
m_logo->setGeometry(QRect(0,0,320,240));
M_Stack->addWidget(m_pMainPage, 0);
Sel.Index.dlong = 0; // init;
resize(QSize(320, 240).expandedTo(minimumSizeHint()) );
흑백 LCD에
흑백 LCD에 출력하려고 하는 BMP 파일의 색상수와 크기부터 확인 부탁드립니다.
========================
조직 : E.L.D(Embedded Linux Developer/Designer)
블로그 : poplinux@tistory.com
카페 : cafe.naver.com/poplinux
임베디드 리눅스 관련 프리렌서 지향
감사합니다.
저는 fb문제가 있다구 생각하고 했는데...ㅠㅠ
그게 아니더군요.
keydriver가 안올라가서 중도에 무한 루프에 빠져있더군요..ㅋㅋ
하여간 감사드립니다.
댓글 달기