------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=122868
------- Additional Comments From slaout linux62 org 2006-03-12 18:27 -------
Yes, that is exactly the same problem I had!
I worked hard to understand it and I now know better the internals of Qt3
drawings.
Here is a snippet of text from the Qt QImage class documentation talking about
how to change the color/alpha of a pixel on a QImage:
> 32-bpp images ignore the color table;
> instead, each pixel contains the RGB triplet.
> 24 bits contain the RGB value;
> the most significant byte is reserved for the alpha buffer.
> QImage image;
> // sets 32 bit pixel at (x,y) to yellow.
> uint *p = (uint *)image.scanLine(y) + x;
> *p = qRgb(255,255,0);
I think the following code should work.
It draw the black top-border.
I keep it to you to draw the three other borders:
uint *p;
for (int column = 0; column < photoImg.width(); ++column) {
p = (uint *)photoImg.scanLine(row) + column;
*p = qRgba(0, 0, 0, 255); // Black and opaque
}
Well, this could be optimized so that resultImage.scanLine(row) is called out
of the for() once and for all...
I keep this work up to you because I copied/pasted it from my project, and
modified it without compiling: so I don't give you a wrong code if I don't
try to optimize without testing.
This code is to put between those two lines (just before the photoImg is
transformed to a QPixmap):
562> delete effect;
563> photoPixmap = photoImg;
And of course, lines 564 to 569 are to be deleted because the borders are now
drawn to the QImage directly and not the QPixmap:
564>QPainter p(&photoPixmap);
565>p.setPen(Qt::black);
566>p.drawLine(0, 0, photoPixmap.width()-1, 0);
567>p.drawLine(0,photoPixmap.height()-1,photoPixmap.width()-1,photoPixmap.height()-1);
568>p.drawLine(0, 0, 0, photoPixmap.height()-1);
569>p.drawLine(photoPixmap.width()-1,0,photoPixmap.width()-1,photoPixmap.height()-1);
_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel