Hi All,
I am working on an application where in which I need to fill the region on QPixmap with the given pattern and color.
The fill pattern is an array of 8 bytes. Each byte is the bit pattern for one row of the fill. Zeroth byte is top row; seventh byte is the bottom row.
I am doing following things.
void fillRegion(const char* pPattern, QColor& fillColor)
{
......
/*
Prepare the image using (8 * 8) pattern with the QImage ( uchar * data, int width, int height, int bytesPerLine, Format format ) constructor
*/
QImage image(pPattern, 8, 8, 1, QImage::Format_MonoLSB);
/*
Prepare a brush with the pattern contained in the image.
Set its color to the specified color.
Reference: http://qt-project.org/doc/qt-4.8/qbrush.html#QBrush-6
Note:
To apply draw a monochrome QImage with color, one way is
to generate a QBitmap from it and construct a QBrush with that
bitmap and the color to use.
*/
QBrush fillPattern(fillColor, QBitmap::fromImage(image));
m_pPainter->fillRect(X, Y, fillRegionWidth, fillRegionHeight, fillPattern);
This solution works fine in Linux Desktop build (OpenSUSE 12.2 , Qt 4.6). However, it is NOT working in ARM platform.
It displays the default Pattern with the black & white color.
Am I missing any thing my implementation? please guide me.
Regards
SRaju
Bookmarks