implemented additional requirement
This commit is contained in:
1 parent
84eea05553
commit
9212be15f4
2 files changed
+18
No files matched your search
@@ -217,6 +217,21 @@ void bitBltBitmap(Dpi::Bitmap &dest, int x, int y, int width, int height,
|
||||
|
||||
void unshareBitmap(Dpi::Bitmap &) {}
|
||||
|
||||
void bitmapReplaceColor(Dpi::Bitmap &dst, int x, int y, int width, int height, QColor oldColor, QColor newColor)
|
||||
{
|
||||
const QRgb oldRgb = oldColor.rgb() & 0xFFFFFFu;
|
||||
const QRgb newRgb = newColor.rgb() & 0xFFFFFFu;
|
||||
Dpi::PixelPointer pixel(&dst.image(), x, y);
|
||||
for (int yy = 0; yy < height; ++yy) {
|
||||
for (int xx = 0; xx < width; ++xx) {
|
||||
if ((pixel.pixelRGB() & 0xFFFFFFu) == oldRgb)
|
||||
pixel.setPixelRGB(newRgb);
|
||||
pixel.nextPixel();
|
||||
}
|
||||
pixel.nextLine();
|
||||
}
|
||||
}
|
||||
|
||||
void sprite(Dpi::Canvas &canvas, GraphicSet &graphicSet, int xDst, int yDst,
|
||||
int width, int height, int xGr, int yGr)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user