當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。