
Originally Posted by
2lights
When a call the TRANSLATE function nothing happens!
That's correct, translating an image will have no effect. The result of calling transformed() is a new image that can encompass the whole original image after applying a transformation to it. When rotating an image, the new resulting image will be larger and will contain all the contents or the original image. When translating, the new image will have the same size as the original one and will contain the whole original image -- which is identical to the original image.
this is what I got:
//Paint Function
if(paintScreen = true){
//Repaint Primary Image
painter.
drawImage(QPoint(0,
0), primaryImage
);
painter.setOpacity(0.5);// drawn at n% opacity
painter.
drawImage(QPoint(0,
0), secondaryImage
);
}
//Paint Function
if(paintScreen = true){
//Repaint Primary Image
painter.drawImage(QPoint(0, 0), primaryImage);
painter.setOpacity(0.5);// drawn at n% opacity
painter.drawImage(QPoint(0, 0), secondaryImage); }
To copy to clipboard, switch view to plain text mode
That's very easy:
painter.drawImage(0, 0, primaryImage);
painter.setOpacity(0.5);
painter.drawImage(colShift, rowShift, secondaryImage);
painter.drawImage(0, 0, primaryImage);
painter.setOpacity(0.5);
painter.drawImage(colShift, rowShift, secondaryImage);
To copy to clipboard, switch view to plain text mode
You can do the same with rotation, by the way:
painter.drawImage(..., ..., primaryImage);
painter.save();
painter.translate(primaryImage.width()/2, primaryImage.height()/2);
painter.rotate(45);
painter.drawImage(..., ..., secondaryImage);
painter.restore();
painter.drawImage(..., ..., primaryImage);
painter.save();
painter.translate(primaryImage.width()/2, primaryImage.height()/2);
painter.rotate(45);
painter.drawImage(..., ..., secondaryImage);
painter.restore();
To copy to clipboard, switch view to plain text mode
Is there a way to convert the whole image into like a "Red Scale" or any other color of different shades
Sure, iterate over all pixels and change their color in any way you want.
Bookmarks