本文整理汇总了C++中ANPPaintInterfaceV0::deletePaint方法的典型用法代码示例。如果您正苦于以下问题:C++ ANPPaintInterfaceV0::deletePaint方法的具体用法?C++ ANPPaintInterfaceV0::deletePaint怎么用?C++ ANPPaintInterfaceV0::deletePaint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ANPPaintInterfaceV0
的用法示例。
在下文中一共展示了ANPPaintInterfaceV0::deletePaint方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setContext
PaintPlugin::~PaintPlugin() {
gPathI.deletePath(m_touchPath);
gPaintI.deletePaint(m_paintSurface);
gPaintI.deletePaint(m_paintButton);
setContext(NULL);
destroySurface();
}
示例2:
AudioPlugin::~AudioPlugin() {
gPaintI.deletePaint(m_paintTrack);
gPaintI.deletePaint(m_paintRect);
gPaintI.deletePaint(m_paintText);
gPaintI.deletePaint(m_paintTrackProgress);
gPaintI.deletePaint(m_paintActiveRect);
if(m_soundPlay->track)
gSoundI.deleteTrack(m_soundPlay->track);
delete m_soundPlay;
}
示例3: drawPlugin
void BackgroundPlugin::drawPlugin(int surfaceWidth, int surfaceHeight) {
// get the plugin's dimensions according to the DOM
PluginObject *obj = (PluginObject*) inst()->pdata;
const int W = obj->window->width;
const int H = obj->window->height;
// compute the current zoom level
const float zoomFactorW = static_cast<float>(surfaceWidth) / W;
const float zoomFactorH = static_cast<float>(surfaceHeight) / H;
// check to make sure the zoom level is uniform
if (zoomFactorW + .01 < zoomFactorH && zoomFactorW - .01 > zoomFactorH)
gLogI.log(kError_ANPLogType, " ------ %p zoom is out of sync (%f,%f)",
inst(), zoomFactorW, zoomFactorH);
// scale the variables based on the zoom level
const int fontSize = (int)(zoomFactorW * 16);
const int leftMargin = (int)(zoomFactorW * 10);
// lock the surface
ANPBitmap bitmap;
JNIEnv* env = NULL;
if (!m_surface || gVM->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK ||
!gSurfaceI.lock(env, m_surface, &bitmap, NULL)) {
gLogI.log(kError_ANPLogType, " ------ %p unable to lock the plugin", inst());
return;
}
// create a canvas
ANPCanvas* canvas = gCanvasI.newCanvas(&bitmap);
gCanvasI.drawColor(canvas, 0xFFFFFFFF);
ANPPaint* paint = gPaintI.newPaint();
gPaintI.setFlags(paint, gPaintI.getFlags(paint) | kAntiAlias_ANPPaintFlag);
gPaintI.setColor(paint, 0xFFFF0000);
gPaintI.setTextSize(paint, fontSize);
ANPTypeface* tf = gTypefaceI.createFromName("serif", kItalic_ANPTypefaceStyle);
gPaintI.setTypeface(paint, tf);
gTypefaceI.unref(tf);
ANPFontMetrics fm;
gPaintI.getFontMetrics(paint, &fm);
gPaintI.setColor(paint, 0xFF0000FF);
const char c[] = "This is a background plugin.";
gCanvasI.drawText(canvas, c, sizeof(c)-1, leftMargin, -fm.fTop, paint);
// clean up variables and unlock the surface
gPaintI.deletePaint(paint);
gCanvasI.deleteCanvas(canvas);
gSurfaceI.unlock(env, m_surface);
}
示例4: paintTouch
void PaintPlugin::paintTouch() {
//TODO do not paint outside the drawing surface
//create the paint color
ANPPaint* strokePaint = gPaintI.newPaint();
gPaintI.setFlags(strokePaint, gPaintI.getFlags(strokePaint) | kAntiAlias_ANPPaintFlag);
gPaintI.setColor(strokePaint, m_activePaintColor);
gPaintI.setStyle(strokePaint, kStroke_ANPPaintStyle);
gPaintI.setStrokeWidth(strokePaint, 6.0);
gPaintI.setStrokeCap(strokePaint, kRound_ANPPaintCap);
gPaintI.setStrokeJoin(strokePaint, kRound_ANPPaintJoin);
// handle the complex "touch" paint (draw a line)
ANPRectF bounds;
gPathI.getBounds(m_touchPath, &bounds);
// get a canvas that is only locked around the point and draw the path
ANPCanvas* canvas = getCanvas(&bounds);
gCanvasI.drawPath(canvas, m_touchPath, strokePaint);
// clean up
releaseCanvas(canvas);
gPaintI.deletePaint(strokePaint);
}
示例5: paintMouse
void PaintPlugin::paintMouse(int x, int y) {
//TODO do not paint outside the drawing surface
//create the paint color
ANPPaint* fillPaint = gPaintI.newPaint();
gPaintI.setFlags(fillPaint, gPaintI.getFlags(fillPaint) | kAntiAlias_ANPPaintFlag);
gPaintI.setStyle(fillPaint, kFill_ANPPaintStyle);
gPaintI.setColor(fillPaint, m_activePaintColor);
// handle the simple "mouse" paint (draw a point)
ANPRectF point;
point.left = (float) x-3;
point.top = (float) y-3;
point.right = (float) x+3;
point.bottom = (float) y+3;
// get a canvas that is only locked around the point and draw it
ANPCanvas* canvas = getCanvas(&point);
gCanvasI.drawOval(canvas, &point, fillPaint);
// clean up
releaseCanvas(canvas);
gPaintI.deletePaint(fillPaint);
}
示例6:
FormPlugin::~FormPlugin() {
gPaintI.deletePaint(m_paintInput);
gPaintI.deletePaint(m_paintActive);
gPaintI.deletePaint(m_paintText);
}
示例7:
NavigationPlugin::~NavigationPlugin() {
gPaintI.deletePaint(m_paintDisabled);
gPaintI.deletePaint(m_paintActive);
}