本文整理汇总了Java中net.rim.device.api.ui.Graphics.drawFilledPath方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.drawFilledPath方法的具体用法?Java Graphics.drawFilledPath怎么用?Java Graphics.drawFilledPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.rim.device.api.ui.Graphics
的用法示例。
在下文中一共展示了Graphics.drawFilledPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paintTransformedBitmap
import net.rim.device.api.ui.Graphics; //导入方法依赖的package包/类
/**
* Paint the transformed Bitmap using the given Graphics context. Paints the
* area transparent before painting the bitmap.
*
* @param g
* the {@link Graphics} context to use - from a screen or bitmap,
* etc.
* @param textureOriginX
* x value in the original bitmap to start drawing from
* @param textureOriginY
* y value in the original bitmap to start drawing from
* @since 1.1
*/
private void paintTransformedBitmap(Graphics g, int textureOriginX, int textureOriginY) {
// Make the drawing space transparent first before painting
g.setGlobalAlpha(getBackgroundAlpha());
g.setBackgroundColor(getBackgroundColor());
g.clear();
g.setGlobalAlpha(255);
/**
* Keep the precision of our transformation and Scale the drawing as
* well. Scale is applied as though a matrix of the form
*
* <pre>
* | ScaleX 0 0|
* | 0 ScaleY 0|
* | 0 0 1|
* </pre>
*
* is multiplied by the Transformation matrix
**/
int dux = Fixed32.div(transformMatrix[UX], resultantScaleX);
int dvx = Fixed32.div(transformMatrix[VX], resultantScaleY);
int duy = Fixed32.div(transformMatrix[UY], resultantScaleX);
int dvy = Fixed32.div(transformMatrix[VY], resultantScaleY);
// Needed for alpha changes in 6.0 with Graphics.clear()
g.setColor(Graphics.WHITE);
g.drawFilledPath(bitmapXPts, bitmapYPts, null, null);
g.drawTexturedPath(bitmapXPts, bitmapYPts, null, null, textureOriginX, textureOriginY, dux, dvx, duy, dvy, bitmap);
}
示例2: draw
import net.rim.device.api.ui.Graphics; //导入方法依赖的package包/类
public void draw(Graphics g, XYRect r) {
super.draw(g, r);
XYEdges padding = getPadding();
int x = r.x + padding.left;
int y = r.y + padding.top;
int width = r.width - padding.left - padding.right;
int height = r.height - padding.top - padding.bottom;
int x1, x2, x3, y1, y2, y3;
if (padding.left > padding.right) {
x1 = x;
y1 = y + height - BalloonBackground.RADIUS / 2;
x2 = x1 - BalloonBackground.PADDING * 2;
y2 = y1 - BalloonBackground.PADDING;
x3 = x1;
y3 = y2 - BalloonBackground.PADDING;
} else {
x1 = x + width;
y1 = y + height - BalloonBackground.RADIUS / 2;
x2 = x1 + BalloonBackground.PADDING * 2;
y2 = y1 - BalloonBackground.PADDING;
x3 = x1;
y3 = y2 - BalloonBackground.PADDING;
}
int[] xes = {x1, x2, x3};
int[] yes = {y1, y2, y3};
int oldColor = g.getColor();
g.setColor(getColor());
g.drawFilledPath(xes, yes, null, null);
g.setColor(oldColor);
}