sapali
26th July 2011, 23:06
Hi,
I am trying to clip an image with a curve by setting the corresponding to-be-clipped pixels to transparent. I am using qt3 and the code follows for transparency does not work.
image.setAlphaBuffer(TRUE);
QColor trans(Qt::color0.rgb());
// QRgb mycol = qRgba ( 255, 255, 255,0 );
// trans.setRgb(mycol);
for (int i = 0; i < img_height; i++){
for (int j = 0; j < img_width; j++){
if (tempimg[i][j] == 0)
image.setPixel(i,j, trans.rgb());
}
}
Any ideas what I'm doing wrong?
Thank you,
Sapal
I am trying to clip an image with a curve by setting the corresponding to-be-clipped pixels to transparent. I am using qt3 and the code follows for transparency does not work.
image.setAlphaBuffer(TRUE);
QColor trans(Qt::color0.rgb());
// QRgb mycol = qRgba ( 255, 255, 255,0 );
// trans.setRgb(mycol);
for (int i = 0; i < img_height; i++){
for (int j = 0; j < img_width; j++){
if (tempimg[i][j] == 0)
image.setPixel(i,j, trans.rgb());
}
}
Any ideas what I'm doing wrong?
Thank you,
Sapal