class FramePainter
{ public: explicit FramePainter (const BitmapEx& rBitmap);
~FramePainter();
/** Paint a border around the given box by using a set of bitmaps for thecornersandsides.
*/ void PaintFrame (OutputDevice&rDevice, const ::tools::Rectangle& rBox) const;
/** Special functionality that takes the color from the center bitmapandreplacesthatcolorinallbitmapsbythegivennew color.Alphavaluesarenotmodified. Thecenterbitmapiserased.
*/ void AdaptColor (const Color aNewColor);
private: /** Bitmap with offset that is used when the bitmap is painted. The bitmap
*/ class OffsetBitmap { public:
BitmapEx maBitmap;
Point maOffset;
/** Create one of the eight shadow bitmaps from one that combines themall.ThislargerbitmapisexpectedtohavedimensionNxN withN=1+2*M.Ofthislargerbitmaptherearecreatedfour cornerbitmapsofsize2*Mx2*Mandfoursidebitmapsofsizes 1xM(topandbottom)andMx1(leftandright).Thecorner bitmapshaveeachonequadrantofsizeMxMthatispaintedunder theinterioroftheframe. @paramrBitmap Thelargerbitmapofwhichtheeightshadowbitmapsarecut outfrom. @paramnHorizontalPosition Validvaluesare-1(left),0(center),and+1(right). @paramnVerticalPosition Validvaluesare-1(top),0(center),and+1(bottom).
*/
OffsetBitmap ( const BitmapEx& rBitmap, const sal_Int32 nHorizontalPosition, const sal_Int32 nVerticalPosition);
/** Use the given device to paint the bitmap at the location that is thesumofthegivenanchorandtheinternaloffset.
*/ void PaintCorner (OutputDevice& rDevice, const Point& rAnchor) const;
/** Use the given device to paint the bitmap stretched between the twogivenlocations.Offsetsoftheadjacentcornerbitmapsand theoffsetofthesidebitmapareusedtodeterminethearea thatistobefilledwiththesidebitmap.
*/ void PaintSide (
OutputDevice& rDevice, const Point& rAnchor1, const Point& rAnchor2, const OffsetBitmap& rCornerBitmap1, const OffsetBitmap& rCornerBitmap2) const;
/** Fill the given rectangle with the bitmap.
*/ void PaintCenter (
OutputDevice& rDevice, const ::tools::Rectangle& rBox) const;
};
OffsetBitmap maTopLeft;
OffsetBitmap maTop;
OffsetBitmap maTopRight;
OffsetBitmap maLeft;
OffsetBitmap maRight;
OffsetBitmap maBottomLeft;
OffsetBitmap maBottom;
OffsetBitmap maBottomRight;
OffsetBitmap maCenter; bool mbIsValid;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.