{
static int X1,Y1,X2,Y2;
Y1 = 5;
Y2 = 10;
QImage cascadeBG
("./images/cascadebackground.png");
QPixmap bufferCascadeBG
(cascadeBG
);
QPainter paintActualArea
(pixmapBackground
);
QPainter paintBufferArea
(&bufferCascadeBG
);
paintActualArea.setBrush(green);
paintBufferArea.setBrush(green);
for( int i=0;i<1500;i++)
{
paintActualArea.drawRect(X1,Y1,5,10);
paintBufferArea.drawRect(X1,Y1,5,10);
X1= X1+25;
X2 = X2+25;
if(X1>1250)
{
X1=0;
Y1 = Y1+10;
Y2 = Y2+10;
}
if(X2>1250)
{
X2=0;
Y1 = Y1+10;
Y2 = Y2+10;
}
}
bitBlt(pixmapBackground, 0, 0, &bufferCascadeBG);
}
void CascadeOverview:paintEvent(QPaintEvent *)
{
static int X1,Y1,X2,Y2;
Y1 = 5;
Y2 = 10;
QImage cascadeBG("./images/cascadebackground.png");
QPixmap bufferCascadeBG(cascadeBG);
QPainter paintActualArea(pixmapBackground);
QPainter paintBufferArea(&bufferCascadeBG);
paintActualArea.setBrush(green);
paintBufferArea.setBrush(green);
for( int i=0;i<1500;i++)
{
paintActualArea.drawRect(X1,Y1,5,10);
paintBufferArea.drawRect(X1,Y1,5,10);
X1= X1+25;
X2 = X2+25;
if(X1>1250)
{
X1=0;
Y1 = Y1+10;
Y2 = Y2+10;
}
if(X2>1250)
{
X2=0;
Y1 = Y1+10;
Y2 = Y2+10;
}
}
bitBlt(pixmapBackground, 0, 0, &bufferCascadeBG);
}
To copy to clipboard, switch view to plain text mode
Bookmarks