hi,
can anyone say me how to draw an image of size 600x400. i tried as follows
uint x,y;
x=550;
y=500;
image.setAlphaBuffer( true );
for ( uint j =0; j <x; j++ )
{
for ( uint i =0; i <y; i++ )
{
QRgb pixel;
pixel = qRgb(0,0,255);
image.setPixel( i, j, pixel );
}
}
p.
drawImage(QPoint(0,
0),image,
0);
QPainter p( this );
uint x,y;
x=550;
y=500;
QImage image(x,y,32 );
image.setAlphaBuffer( true );
for ( uint j =0; j <x; j++ )
{
for ( uint i =0; i <y; i++ )
{
QRgb pixel;
pixel = qRgb(0,0,255);
image.setPixel( i, j, pixel );
}
}
p.drawImage(QPoint(0,0),image,0);
To copy to clipboard, switch view to plain text mode
when i executed this it said the following error:
"
QImage::scanLine: Index 500 out of range
Segmentation fault ".
but i can succesfuly draw an image of size 500x500.
can anyone say me why is that so ..
thanks in advance,
saravanan
Bookmarks