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


Java Path.computeBounds方法代码示例

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


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

示例1: doTextContainer

import android.graphics.Path; //导入方法依赖的package包/类
@Override
public boolean doTextContainer(TextContainer obj) {
	if (obj instanceof SVG.TextPath) {
		// Since we cheat a bit with our textPath rendering, we need
		// to cheat a bit with our bbox calculation.
		SVG.TextPath tpath = (SVG.TextPath) obj;
		SVG.SvgObject ref = obj.document.resolveIRI(tpath.href);
		if (ref == null) {
			error("TextPath path reference '%s' not found", tpath.href);
			return false;
		}
		SVG.Path pathObj = (SVG.Path) ref;
		Path path = (new PathConverter(pathObj.d)).getPath();
		if (pathObj.transform != null)
			path.transform(pathObj.transform);
		RectF pathBounds = new RectF();
		path.computeBounds(pathBounds, true);
		bbox.union(pathBounds);
		return false;
	}
	return true;
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:23,代码来源:SVGAndroidRenderer.java

示例2: getScaleMatrix

import android.graphics.Path; //导入方法依赖的package包/类
public Matrix getScaleMatrix(Path srcPath, float scaleX, float scaleY) {
    Matrix scaleMatrix = new Matrix();
    RectF rectF = new RectF();
    srcPath.computeBounds(rectF, true);
    scaleMatrix.setScale(scaleX, scaleY, rectF.left, rectF.top);
    return scaleMatrix;
}
 
开发者ID:harjot-oberai,项目名称:VectorMaster,代码行数:8,代码来源:PathModel.java

示例3: setPath

import android.graphics.Path; //导入方法依赖的package包/类
public PathShape setPath(final Path path) {
    this.path = path;
    path.computeBounds(pathBounds, false);
    return this;
}
 
开发者ID:florent37,项目名称:MyLittleCanvas,代码行数:6,代码来源:PathShape.java

示例4: calculatePathBounds

import android.graphics.Path; //导入方法依赖的package包/类
private Box calculatePathBounds(Path path) {
	RectF pathBounds = new RectF();
	path.computeBounds(pathBounds, true);
	return new Box(pathBounds.left, pathBounds.top, pathBounds.width(),
			pathBounds.height());
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:7,代码来源:SVGAndroidRenderer.java

示例5: run

import android.graphics.Path; //导入方法依赖的package包/类
@Override
public void run() {
    InputStream inputStream = context.getResources().openRawResource(R.raw.taiwanhigh);
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = null;

    try {
        builder = factory.newDocumentBuilder();
        Document doc = builder.parse(inputStream);

        Element rootElement = doc.getDocumentElement();
        NodeList items = rootElement.getElementsByTagName("path");
        for (int i = 0; i <items.getLength() ; i++) {
            Element element = (Element) items.item(i);
            String pathData = element.getAttribute("android:pathData");

            Path path = PathParser.createPathFromPathData(pathData);


            RectF rectF = new RectF();
            path.computeBounds(rectF,true);

            left = left == -1 ? rectF.left : Math.min(rectF.left,left);
            top = top == -1 ? rectF.top : Math.min(rectF.top,top);

            right = right == -1 ? rectF.right : Math.max(rectF.right,right);
            bottom = bottom == -1 ? rectF.bottom : Math.max(rectF.bottom,bottom);



            CountyItem countyItem = new CountyItem(path);

            countyItems.add(countyItem);


        }
        topRectF = new RectF(left,top,right,bottom);
        handler.sendEmptyMessage(1);
    } catch (Exception e) {
        e.printStackTrace();
    }


}
 
开发者ID:fanxiaole,项目名称:SVG_taiwan_View,代码行数:45,代码来源:MapView.java


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