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


Java SVG.getPicture方法代码示例

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


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

示例1: SVGTileProvider

import com.larvalabs.svgandroid.SVG; //导入方法依赖的package包/类
public SVGTileProvider(File file, float dpi) throws IOException {
    mScale = Math.round(dpi + .3f); // Make it look nice on N7 (1.3 dpi)
    mDimension = BASE_TILE_SIZE * mScale;

    mPool = new TileGeneratorPool(POOL_MAX_SIZE);

    SVG svg = new SVGBuilder().readFromInputStream(new FileInputStream(file)).build();
    mSvgPicture = svg.getPicture();
    RectF limits = svg.getLimits();

    mBaseMatrix = new Matrix();
    mBaseMatrix.setPolyToPoly(
            new float[]{
                    0, 0,
                    limits.width(), 0,
                    limits.width(), limits.height()
            }, 0,
            new float[]{
                    40.95635986328125f, 98.94217824936158f,
                    40.95730018615723f, 98.94123077396628f,
                    40.95791244506836f, 98.94186019897214f
            }, 0, 3
    );
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:25,代码来源:SVGTileProvider.java

示例2: SVGTileProvider

import com.larvalabs.svgandroid.SVG; //导入方法依赖的package包/类
public SVGTileProvider(File file, float dpi) throws IOException {
    mScale = Math.round(dpi + .3f); // Make it look nice on N7 (1.3 dpi)
    mDimension = BASE_TILE_SIZE * mScale;

    mPool = new TileGeneratorPool(POOL_MAX_SIZE);

    SVG svg = new SVGBuilder().readFromInputStream(new FileInputStream(file)).build();
    mSvgPicture = svg.getPicture();
    RectF limits = svg.getLimits();

    // These values map the SVG file to world coordinates.
    // See: http://stackoverflow.com/questions/21167584/google-io-2013-app-mystery-values
    mBaseMatrix = new Matrix();
    mBaseMatrix.setPolyToPoly(
            new float[]{
                    0, 0, // North-West
                    limits.width(), 0, // North-East
                    limits.width(), limits.height() // South-East
            }, 0, BuildConfig.MAP_FLOORPLAN_MAPPING, 0, 3
    );
}
 
开发者ID:google,项目名称:iosched,代码行数:22,代码来源:SVGTileProvider.java

示例3: getBackgroundObject

import com.larvalabs.svgandroid.SVG; //导入方法依赖的package包/类
public Object getBackgroundObject(String name) throws IOException {
    InputStream stream = getInputStream(name);
    try {
        if (name.endsWith(".svg")) {
            SVG svg = new SVGBuilder().readFromString(FileUtils.readAllText(stream)).build();
            return svg.getPicture();
        } else if (name.endsWith(".png")) {
            return BitmapFactory.decodeStream(stream);
        }else {
            throw new IOException("Unsupported type of image file " + name);
        }
    } finally {
        stream.close();
    }
}
 
开发者ID:RomanGolovanov,项目名称:ametro,代码行数:16,代码来源:ZipArchiveMapProvider.java

示例4: SVGTileProvider

import com.larvalabs.svgandroid.SVG; //导入方法依赖的package包/类
public SVGTileProvider(File file, float dpi) throws IOException {
    mScale = Math.round(dpi + .3f); // Make it look nice on N7 (1.3 dpi)
    mDimension = BASE_TILE_SIZE * mScale;

    mPool = new TileGeneratorPool(POOL_MAX_SIZE);

    SVG svg = new SVGBuilder().readFromInputStream(new FileInputStream(file)).build();
    mSvgPicture = svg.getPicture();
    RectF limits = svg.getLimits();

    mBaseMatrix = new Matrix();
    mBaseMatrix.setPolyToPoly(
            new float[]{
                    0, 0,
                    limits.width(), 0,
                    limits.width(), limits.height(),
                    0, limits.height()
            }, 0,
            new float[]{
                    lon2x(-84.3965270742774),lat2y(33.76028996243774),
                    lon2x(-84.3958156183362),lat2y(33.760276861729395),
                    lon2x(-84.39581125974655),lat2y( 33.7582431615339),
                    lon2x(-84.39653344452381),lat2y( 33.7582526388671)

            }, 0, 4
    );
}
 
开发者ID:secondsun,项目名称:devnexus-android,代码行数:28,代码来源:SVGTileProvider.java

示例5: SVGPictureDrawable

import com.larvalabs.svgandroid.SVG; //导入方法依赖的package包/类
public SVGPictureDrawable(SVG svg) {
    super(svg.getPicture());
    RectF bounds = svg.getBounds();
    RectF limits = svg.getLimits();
    if (bounds != null) {
        iWidth = (int)bounds.width();
        iHeight = (int)bounds.height();
    } else if (limits != null) {
        iWidth = (int)limits.width();
        iHeight = (int)limits.height();
    } else {
        iWidth = -1;
        iHeight = -1;
    }
}
 
开发者ID:spdd,项目名称:chessonline,代码行数:16,代码来源:SVGPictureDrawable.java

示例6: setClef

import com.larvalabs.svgandroid.SVG; //导入方法依赖的package包/类
public void setClef(Clef clef) {
    _clef = clef;
    SVG svg = SVGParser.getSVGFromResource(getResources(), clef._svgResource);
    _clefPic = svg.getPicture();
    int scaledWidth = _clefPic.getWidth() * _clef._height / _clefPic.getHeight();
    _clefRect = new Rect(_clefLeft, _clef._top,
                         _clefLeft + scaledWidth, _clef._top + _clef._height);
}
 
开发者ID:ydirson,项目名称:NotesTrainer,代码行数:9,代码来源:ScoreView.java


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