当前位置: 首页>>代码示例>>Java>>正文


Java Picture.endRecording方法代码示例

本文整理汇总了Java中android.graphics.Picture.endRecording方法的典型用法代码示例。如果您正苦于以下问题:Java Picture.endRecording方法的具体用法?Java Picture.endRecording怎么用?Java Picture.endRecording使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.graphics.Picture的用法示例。


在下文中一共展示了Picture.endRecording方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderViewToPicture

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * Renders this SVG document to a Picture object using the specified view defined in the document.
 * <p>
 * A View is an special element in a SVG document that describes a rectangular area in the document.
 * Calling this method with a {@code viewId} will result in the specified view being positioned and scaled
 * to the viewport.  In other words, use {@link #renderToPicture()} to render the whole document, or use this
 * method instead to render just a part of it.
 *
 * @param viewId         the id of a view element in the document that defines which section of the document is to be visible.
 * @param widthInPixels  the width of the initial viewport
 * @param heightInPixels the height of the initial viewport
 * @return a Picture object suitable for later rendering using {@code Canvas.drawPicture()}, or null if the viewId was not found.
 */
public Picture renderViewToPicture(String viewId, int widthInPixels, int heightInPixels) {
    SvgObject obj = this.getElementById(viewId);
    if (obj == null)
        return null;
    if (!(obj instanceof SVG.View))
        return null;

    SVG.View view = (SVG.View) obj;

    if (view.viewBox == null) {
        Log.w(TAG, "View element is missing a viewBox attribute.");
        return null;
    }

    Picture picture = new Picture();
    Canvas canvas = picture.beginRecording(widthInPixels, heightInPixels);
    Box viewPort = new Box(0f, 0f, (float) widthInPixels, (float) heightInPixels);

    SVGAndroidRenderer renderer = new SVGAndroidRenderer(canvas, viewPort, this.renderDPI);

    renderer.renderDocument(this, view.viewBox, view.preserveAspectRatio, false);

    picture.endRecording();
    return picture;
}
 
开发者ID:StepicOrg,项目名称:stepik-android,代码行数:39,代码来源:SVG.java

示例2: renderViewToPicture

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * Renders this SVG document to a Picture object using the specified view defined in the document.
 * <p/>
 * A View is an special element in a SVG document that describes a rectangular area in the document.
 * Calling this method with a {@code viewId} will result in the specified view being positioned and scaled
 * to the viewport.  In other words, use {@link #renderToPicture()} to render the whole document, or use this
 * method instead to render just a part of it.
 *
 * @param viewId         the id of a view element in the document that defines which section of the document is to
 *                       be visible.
 * @param widthInPixels  the width of the initial viewport
 * @param heightInPixels the height of the initial viewport
 * @return a Picture object suitable for later rendering using {@code Canvas.drawPicture()},
 * or null if the viewId was not found.
 */
public Picture renderViewToPicture(String viewId, int widthInPixels, int heightInPixels) {
    SvgObject obj = this.getElementById(viewId);
    if (obj == null)
        return null;
    if (!(obj instanceof SVG.View))
        return null;

    SVG.View view = (SVG.View) obj;

    if (view.viewBox == null) {
        Log.w(TAG, "View element is missing a viewBox attribute.");
        return null;
    }

    Picture picture = new Picture();
    Canvas canvas = picture.beginRecording(widthInPixels, heightInPixels);
    Box viewPort = new Box(0f, 0f, (float) widthInPixels, (float) heightInPixels);

    SVGAndroidRenderer renderer = new SVGAndroidRenderer(canvas, viewPort, this.renderDPI);

    renderer.renderDocument(this, view.viewBox, view.preserveAspectRatio, false);

    picture.endRecording();
    return picture;
}
 
开发者ID:robinxdroid,项目名称:XDroidAnimation,代码行数:41,代码来源:SVG.java

示例3: renderToPicture

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * Renders this SVG document to a Picture object.
 * 
 * @param widthInPixels
 *            the width of the initial viewport
 * @param heightInPixels
 *            the height of the initial viewport
 * @return a Picture object suitable for later rendering using
 *         {@code Canvas.darwPicture()}
 */
public Picture renderToPicture(int widthInPixels, int heightInPixels) {
	Picture picture = new Picture();
	Canvas canvas = picture.beginRecording(widthInPixels, heightInPixels);
	Box viewPort = new Box(0f, 0f, (float) widthInPixels,
			(float) heightInPixels);

	SVGAndroidRenderer renderer = new SVGAndroidRenderer(canvas, viewPort,
			this.renderDPI);

	renderer.renderDocument(this, null, null, false);

	picture.endRecording();
	return picture;
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:25,代码来源:SVG.java

示例4: renderViewToPicture

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * Renders this SVG document to a Picture object using the specified view
 * defined in the document.
 * <p>
 * A View is an special element in a SVG document that describes a
 * rectangular area in the document. Calling this method with a
 * {@code viewId} will result in the specified view being positioned and
 * scaled to the viewport. In other words, use {@link #renderToPicture()} to
 * render the whole document, or use this method instead to render just a
 * part of it.
 * 
 * @param viewId
 *            the id of a view element in the document that defines which
 *            section of the document is to be visible.
 * @param widthInPixels
 *            the width of the initial viewport
 * @param heightInPixels
 *            the height of the initial viewport
 * @return a Picture object suitable for later rendering using
 *         {@code Canvas.drawPicture()}, or null if the viewId was not
 *         found.
 */
public Picture renderViewToPicture(String viewId, int widthInPixels,
		int heightInPixels) {
	SvgObject obj = this.getElementById(viewId);
	if (obj == null)
		return null;
	if (!(obj instanceof SVG.View))
		return null;

	SVG.View view = (SVG.View) obj;

	if (view.viewBox == null) {
		Log.w(TAG, "View element is missing a viewBox attribute.");
		return null;
	}

	Picture picture = new Picture();
	Canvas canvas = picture.beginRecording(widthInPixels, heightInPixels);
	Box viewPort = new Box(0f, 0f, (float) widthInPixels,
			(float) heightInPixels);

	SVGAndroidRenderer renderer = new SVGAndroidRenderer(canvas, viewPort,
			this.renderDPI);

	renderer.renderDocument(this, view.viewBox, view.preserveAspectRatio,
			false);

	picture.endRecording();
	return picture;
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:52,代码来源:SVG.java

示例5: getPictureFromBitmap

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * bitmap to picture
 *
 * @param bitmap
 * @return
 */
public static Picture getPictureFromBitmap(Bitmap bitmap) {
    Picture picture = new Picture();
    Canvas canvas = picture.beginRecording(bitmap.getWidth(),
            bitmap.getHeight());
    canvas.drawBitmap(
            bitmap,
            null,
            new RectF(0f, 0f, (float) bitmap.getWidth(), (float) bitmap
                    .getHeight()), null);
    picture.endRecording();
    return picture;
}
 
开发者ID:onlylemi,项目名称:MapView,代码行数:19,代码来源:MapUtils.java

示例6: renderToPicture

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * Renders this SVG document to a Picture object.
 *
 * @param widthInPixels  the width of the initial viewport
 * @param heightInPixels the height of the initial viewport
 * @return a Picture object suitable for later rendering using {@code Canvas.darwPicture()}
 */
public Picture renderToPicture(int widthInPixels, int heightInPixels) {
    Picture picture = new Picture();
    Canvas canvas = picture.beginRecording(widthInPixels, heightInPixels);
    Box viewPort = new Box(0f, 0f, (float) widthInPixels, (float) heightInPixels);

    SVGAndroidRenderer renderer = new SVGAndroidRenderer(canvas, viewPort, this.renderDPI);

    renderer.renderDocument(this, null, null, false);

    picture.endRecording();
    return picture;
}
 
开发者ID:StepicOrg,项目名称:stepik-android,代码行数:20,代码来源:SVG.java

示例7: setImageBitmap

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * Displays a bitmap
 *
 * @param bitmap
 *            {@link Bitmap}
 */
public void setImageBitmap(Bitmap bitmap) {
    setZoom(1.0f, false);
    setContentSize(bitmap.getWidth(), bitmap.getHeight());

    picture = new Picture();
    Canvas c = picture
            .beginRecording(bitmap.getWidth(), bitmap.getHeight());
    c.drawBitmap(bitmap, 0, 0, null);
    picture.endRecording();
}
 
开发者ID:MaKeAppDev,项目名称:Redpin,代码行数:17,代码来源:ZoomAndScrollImageView.java

示例8: resizePicture

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * Return a differently sized picture
 */
public Picture resizePicture(int height, int width){
    Picture newPicture = new Picture();
    Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    Canvas canvas = new Canvas(bitmap);
    canvas = newPicture.beginRecording(width, height);
    canvas.drawPicture(picture, new Rect(0,0,width,height));
    newPicture.endRecording();
    return newPicture;
}
 
开发者ID:thinkingcow,项目名称:svg-android-2,代码行数:13,代码来源:SVG.java

示例9: renderToPicture

import android.graphics.Picture; //导入方法依赖的package包/类
@SuppressWarnings({"WeakerAccess", "unused"})
public Picture  renderToPicture(int widthInPixels, int heightInPixels)
{
   Picture  picture = new Picture();
   Canvas   canvas = picture.beginRecording(widthInPixels, heightInPixels);
   Box      viewPort = new Box(0f, 0f, (float) widthInPixels, (float) heightInPixels);

   SVGAndroidRenderer  renderer = new SVGAndroidRenderer(canvas, this.renderDPI);

   renderer.renderDocument(this, viewPort, null, null, false);

   picture.endRecording();
   return picture;
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:15,代码来源:SVG.java

示例10: renderViewToPicture

import android.graphics.Picture; //导入方法依赖的package包/类
@SuppressWarnings({"WeakerAccess", "unused"})
public Picture  renderViewToPicture(String viewId, int widthInPixels, int heightInPixels)
{
   SvgObject  obj = this.getElementById(viewId);
   if (obj == null)
      return null;
   if (!(obj instanceof SVG.View))
      return null;

   SVG.View  view = (SVG.View) obj;
   
   if (view.viewBox == null) {
      Log.w(TAG, "View element is missing a viewBox attribute.");
      return null;
   }

   Picture  picture = new Picture();
   Canvas   canvas = picture.beginRecording(widthInPixels, heightInPixels);
   Box      viewPort = new Box(0f, 0f, (float) widthInPixels, (float) heightInPixels);

   SVGAndroidRenderer  renderer = new SVGAndroidRenderer(canvas, this.renderDPI);

   renderer.renderDocument(this, viewPort, view.viewBox, view.preserveAspectRatio, false);

   picture.endRecording();
   return picture;
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:28,代码来源:SVG.java

示例11: renderToImage

import android.graphics.Picture; //导入方法依赖的package包/类
public Picture renderToImage(Rect bounds) {
    if (document != null) {
        Picture image = new Picture();
        try {
            Canvas c = image.beginRecording(bounds.width(), bounds.height());
            document.render(c);
        } catch (Exception ioe) {
            PXLog.e(TAG, ioe, "Error rendering to image");
        } finally {
            image.endRecording();
        }
        return image;
    }
    return null;
}
 
开发者ID:Pixate,项目名称:pixate-freestyle-android,代码行数:16,代码来源:PXShapeView.java

示例12: createCompassRosePicture

import android.graphics.Picture; //导入方法依赖的package包/类
public static Picture createCompassRosePicture(final int mCompassRadius, final float displayDensity, final Paint northPaint, final Paint southPaint, final Paint centerPaint) {

        // final int picBorderWidthAndHeight = (int) ((mCompassRadius + 5) * 2 *
        // mScale);
        final int picBorderWidthAndHeight = (int) ((mCompassRadius + 5) * 2);
        final int center = picBorderWidthAndHeight / 2;

        // Record Rose
        Picture mCompassRose = new Picture();
        final Canvas canvas = mCompassRose.beginRecording(picBorderWidthAndHeight, picBorderWidthAndHeight);

        // Blue triangle pointing north
        final Path pathNorth = new Path();
        pathNorth.moveTo(center, center - (mCompassRadius - 3) * displayDensity);
        pathNorth.lineTo(center + 4 * displayDensity, center);
        pathNorth.lineTo(center - 4 * displayDensity, center);
        pathNorth.lineTo(center, center - (mCompassRadius - 3) * displayDensity);
        pathNorth.close();
        canvas.drawPath(pathNorth, northPaint);

        // Red triangle pointing south
        final Path pathSouth = new Path();
        pathSouth.moveTo(center, center + (mCompassRadius - 3) * displayDensity);
        pathSouth.lineTo(center + 4 * displayDensity, center);
        pathSouth.lineTo(center - 4 * displayDensity, center);
        pathSouth.lineTo(center, center + (mCompassRadius - 3) * displayDensity);
        pathSouth.close();
        canvas.drawPath(pathSouth, southPaint);

        // Draw a little white dot in the middle
        canvas.drawCircle(center, center, 2, centerPaint);

        mCompassRose.endRecording();
        return mCompassRose;

    }
 
开发者ID:gabuzomeu,项目名称:osmLib,代码行数:37,代码来源:CompassPictureFactory.java

示例13: recordBitmapIntoPicture

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * Creates a new Picture that records drawing a provided bitmap.
 * Will return an empty Picture if the Bitmap is null.
 */
@CalledByNative
private static Picture recordBitmapIntoPicture(Bitmap bitmap) {
    Picture picture = new Picture();
    if (bitmap != null) {
        Canvas recordingCanvas = picture.beginRecording(bitmap.getWidth(), bitmap.getHeight());
        drawBitmapIntoCanvas(bitmap, recordingCanvas, 0, 0);
        picture.endRecording();
    }
    return picture;
}
 
开发者ID:mogoweb,项目名称:chromium_webview,代码行数:15,代码来源:JavaBrowserViewRendererHelper.java

示例14: setImageBitmap

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * Displays a bitmap
 * 
 * @param bitmap
 *            {@link Bitmap}
 */
public void setImageBitmap(Bitmap bitmap) {
	setZoom(1.0f, false);
	setContentSize(bitmap.getWidth(), bitmap.getHeight());

	picture = new Picture();
	Canvas c = picture
			.beginRecording(bitmap.getWidth(), bitmap.getHeight());
	c.drawBitmap(bitmap, 0, 0, null);
	picture.endRecording();
}
 
开发者ID:BenjaminMesre,项目名称:UPMCarte,代码行数:17,代码来源:ZoomAndScrollImageView.java

示例15: drawBarreds

import android.graphics.Picture; //导入方法依赖的package包/类
/**
 * @return
 */
private Picture drawBarreds() {
	Picture pictureContent = new Picture();
	Canvas canvasContent = pictureContent.beginRecording(getWidth(), getHeight()); 
	Paint paintContent = new Paint(Paint.ANTI_ALIAS_FLAG);
	canvasContent.save();
	
	paintContent.setColor(Color.BLUE);
	paintContent.setStyle(Style.STROKE);
	paintContent.setStrokeWidth(2);
	paintContent.setAlpha(50);

	try {
		cellDimension = block.getCellDimension();
		JSONArray barred = block.getBarred();

		int rows = block.getShape().getInt(0);
		int cols = block.getShape().getInt(1);

		// this code draws all the shape:
		for (int i = 0; i < rows; i++) {               
			for (int j = 0; j < cols; j++) {               
				
				canvasContent.drawRect(cellDimension * j, 
								   		cellDimension * i, 
								   		cellDimension * j + cellDimension, 
								   		cellDimension * i + cellDimension, 
								   		paintContent);
			}
		}			
		paintContent.setColor(Color.RED);
		paintContent.setStyle(Style.FILL);
		paintContent.setAlpha(50);

		
		for (int i = 0; i < barred.length(); i++) {               
			JSONArray pos = barred.getJSONArray(i);
			canvasContent.drawRect(cellDimension * pos.getInt(1), 
								   cellDimension * pos.getInt(0), 
								   cellDimension * pos.getInt(1) + cellDimension, 
								   cellDimension * pos.getInt(0) + cellDimension, 
								   paintContent);
		}
		
		this.paintBoxList(canvasContent, paintContent);
		

	
	} catch (JSONException e) {
		e.printStackTrace();
		Log.e("Exception in DrawComponents.drawBarreds",""+e.getMessage());
	}

	canvasContent.restore();		
	pictureContent.endRecording();
	return pictureContent;

}
 
开发者ID:CRS4-IOT,项目名称:indoorlib,代码行数:61,代码来源:CustomView.java


注:本文中的android.graphics.Picture.endRecording方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。