unsigned int tbuffer[640*480];
img = QImage( 640, 480, QImage::Format_RGB32 );
unsigned int *p = (unsigned int*)(tbuffer);
for(int a=0;a<480;a++)
{
for(int b=0;b<640;b++)
{
(*p)=0x00000000;
#if 0
if(b<80)
{
(*p)=0x00ff0000;
}
else if((b>=80)&&(b<160))
{
(*p)=0x0000ff00;
}
else if((b>=160)&&(b<240))
{
(*p)=0x000000ff;
}
else
{
(*p)=0x00ff0000;
}
#endif
p++;
}
}
unsigned int abuffer[640*480];
unsigned int *p1 = (unsigned int*)(abuffer);
for(int i=0;i<480;i++)
{
for(int j=0;j<640;j++)
{
(*p1)=0x00ffffff;
#if 0
if(j<80)
{
(*p1)=0x00ff00ff;
}
else if((j>=80)&&(j<160))
{
(*p1)=0x00ff00;
}
else if((j>=160)&&(j<240))
{
(*p1)=0x0000ff00;
}
else
{
(*p1)=0x00ff00ff;
}
#endif
p1++;
}
}
static char e;
if(e)
{
memcpy( img.bits(),abuffer, 640 * 480 * 4 );
e=!e;
//qDebug()<<"11111111111111111111111111111";
}
else
{
memcpy( img.bits(),tbuffer, 640 * 480 * 4 );
e=!e;
//qDebug()<<"2222222222222222222222222222222";
}
pixmap = QPixmap::fromImage(img);
label->setPixmap(pixmap);