sar_van81
12th March 2007, 09:11
hi,
can anyone say me how to draw an image of size 600x400. i tried as follows
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);
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
can anyone say me how to draw an image of size 600x400. i tried as follows
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);
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