LibreOffice
LibreOffice 24.2 SDK API Reference
|
Provides the basic graphical output operations for a canvas. More...
import"XSimpleCanvas.idl";
Public Member Functions | |
void | selectFont ([in] string sFontName, [in]double size, [in] boolean bold, [in] boolean italic) |
Select a font. More... | |
void | setPenColor ([in] com::sun::star::util::Color nsRgbaColor) |
Sets the color used by line and text operations. More... | |
void | setFillColor ([in] com::sun::star::util::Color nsRgbaColor) |
Sets the fill color. More... | |
void | setRectClip ([in] ::com::sun::star::geometry::RealRectangle2D aRect) |
Sets the clip to the specified rectangle. More... | |
void | setTransformation ([in] ::com::sun::star::geometry::AffineMatrix2D aTransform) |
Set the current transform matrix. More... | |
void | drawPixel ([in] ::com::sun::star::geometry::RealPoint2D aPoint) |
Sets a single pixel on the canvas. More... | |
void | drawLine ([in] ::com::sun::star::geometry::RealPoint2D aStartPoint, [in] ::com::sun::star::geometry::RealPoint2D aEndPoint) |
Draws a line on the canvas. More... | |
void | drawRect ([in] ::com::sun::star::geometry::RealRectangle2D aRect) |
Draws a rectangle on the canvas. More... | |
void | drawPolyPolygon ([in] XPolyPolygon2D xPolyPolygon) |
Draws a poly-polygon on the canvas. More... | |
void | drawText ([in] StringContext aText, [in] ::com::sun::star::geometry::RealPoint2D aOutPos, [in] byte nTextDirection) |
Draws text on the canvas. More... | |
void | drawBitmap ([in] XBitmap xBitmap, [in] ::com::sun::star::geometry::RealPoint2D aLeftTop) |
Draws the bitmap on the canvas. More... | |
XGraphicDevice | getDevice () |
Request the associated graphic device for this canvas. More... | |
XCanvas | getCanvas () |
Query the underlying XCanvas. More... | |
FontMetrics | getFontMetrics () |
Request the font metrics of the current font. More... | |
XCanvasFont | getCurrentFont () |
Retrieve currently selected font. More... | |
com::sun::star::util::Color | getCurrentPenColor () |
Retrieve color currently used for lines. More... | |
com::sun::star::util::Color | getCurrentFillColor () |
Retrieve color currently used for fills. More... | |
com::sun::star::geometry::RealRectangle2D | getCurrentClipRect () |
Retrieve current clip rect. More... | |
com::sun::star::geometry::AffineMatrix2D | getCurrentTransformation () |
Retrieve current transformation matrix. More... | |
ViewState | getCurrentViewState () |
Retrieve view state. More... | |
RenderState | getCurrentRenderState ([in] boolean bUseFillColor) |
Retrieve render state. More... | |
Public Member Functions inherited from XInterface | |
any | queryInterface ([in] type aType) |
queries for a new interface to an existing UNO object. More... | |
void | acquire () |
increases the reference counter by one. More... | |
void | release () |
decreases the reference counter by one. More... | |
Provides the basic graphical output operations for a canvas.
This interface is a simplified version of the XCanvas interface. It holds explicit state, i.e. the pen and fill color, the current transformation, clip and font are persistently remembered.
In contrast to the XCanvas interface, XSimpleCanvas does not distinguish between stroke and fill operations; instead, switching between stroke and fill (or taking both) works by setting appropriate pen and fill colors.
void drawBitmap | ( | [in] XBitmap | xBitmap, |
[in] ::com::sun::star::geometry::RealPoint2D | aLeftTop | ||
) |
Draws the bitmap on the canvas.
xBitmap | Bitmap to render |
aLeftTop | Left, top position of the bitmap on the destination canvas. |
void drawLine | ( | [in] ::com::sun::star::geometry::RealPoint2D | aStartPoint, |
[in] ::com::sun::star::geometry::RealPoint2D | aEndPoint | ||
) |
Draws a line on the canvas.
void drawPixel | ( | [in] ::com::sun::star::geometry::RealPoint2D | aPoint | ) |
Sets a single pixel on the canvas.
void drawPolyPolygon | ( | [in] XPolyPolygon2D | xPolyPolygon | ) |
Draws a poly-polygon on the canvas.
void drawRect | ( | [in] ::com::sun::star::geometry::RealRectangle2D | aRect | ) |
Draws a rectangle on the canvas.
void drawText | ( | [in] StringContext | aText, |
[in] ::com::sun::star::geometry::RealPoint2D | aOutPos, | ||
[in] byte | nTextDirection | ||
) |
Draws text on the canvas.
aText | Text to render. The text color is the current pen color. |
aOutPos | Output position of the text. This is the left or right edge, depending on nTextDirection. Output position is always relative to the font baseline. |
nTextDirection | A value from the TextDirection collection, denoting the main writing direction for this string. The main writing direction determines the origin of the text output, i.e. the left edge for left-to-right and the right edge for right-to-left text. |
XCanvas getCanvas | ( | ) |
Query the underlying XCanvas.
com::sun::star::geometry::RealRectangle2D getCurrentClipRect | ( | ) |
Retrieve current clip rect.
com::sun::star::util::Color getCurrentFillColor | ( | ) |
Retrieve color currently used for fills.
XCanvasFont getCurrentFont | ( | ) |
Retrieve currently selected font.
com::sun::star::util::Color getCurrentPenColor | ( | ) |
Retrieve color currently used for lines.
RenderState getCurrentRenderState | ( | [in] boolean | bUseFillColor | ) |
Retrieve render state.
bUseFillColor | When true, the Color member of the RenderState is initialized with the current fill color; when false, the current pen color is used. |
com::sun::star::geometry::AffineMatrix2D getCurrentTransformation | ( | ) |
Retrieve current transformation matrix.
ViewState getCurrentViewState | ( | ) |
Retrieve view state.
XGraphicDevice getDevice | ( | ) |
Request the associated graphic device for this canvas.
A graphic device provides methods specific to the underlying output device capabilities, which are common for all canvases rendering to such a device. This includes device resolution, color space, or bitmap formats.
FontMetrics getFontMetrics | ( | ) |
Request the font metrics of the current font.
void selectFont | ( | [in] string | sFontName, |
[in] double | size, | ||
[in] boolean | bold, | ||
[in] boolean | italic | ||
) |
Select a font.
This method selects the specified font (or a close substitute) as the current font for text output.
sFontName | The name of the font (like e.g. Arial) |
size | The size of the font (note that this is not the usual points unit, but in the same coordinate system as the other rendering operations - usually, device pixel). |
bold | When true, selected font is bold. |
italic | When true, selected font is italic |
void setFillColor | ( | [in] com::sun::star::util::Color | nsRgbaColor | ) |
Sets the fill color.
To disable filling, simply set this color to something with zero alpha (i.e. fully transparent).
nsRgbaColor | RGBA color tuple, interpreted in the sRGB color space. |
void setPenColor | ( | [in] com::sun::star::util::Color | nsRgbaColor | ) |
Sets the color used by line and text operations.
To disable stroking, simply set this color to something with zero alpha (i.e. fully transparent).
nsRgbaColor | RGBA color tuple, interpreted in the sRGB color space. |
void setRectClip | ( | [in] ::com::sun::star::geometry::RealRectangle2D | aRect | ) |
Sets the clip to the specified rectangle.
void setTransformation | ( | [in] ::com::sun::star::geometry::AffineMatrix2D | aTransform | ) |
Set the current transform matrix.