java类android.graphics.Picture的实例源码

ImageUtils.java 文件源码 项目:gamesboard 阅读 30 收藏 0 点赞 0 评论 0
public static Bitmap createBitmap(InputStream in, int w, int h, boolean closeStream) {
        if (in == null) {
            return null;
        }
        com.larvalabs.svgandroid.SVG svg;
        svg = new SVGBuilder().readFromInputStream(in).build();

        Bitmap bitmap = Bitmap.createBitmap(w, h, Config.ARGB_8888);
        Canvas canvas = new Canvas(bitmap);
        Picture pic = svg.getPicture();
//        svg.renderToCanvas(canvas/*, new RectF(0f, 0f, (float)w, (float)h)*/);
//        svg.renderToCanvas(canvas, new RectF(0f, 0f, (float)w, (float)h));
        canvas.drawPicture(pic, new Rect(0, 0, w, h));
        if (closeStream) {
            try {
                in.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return bitmap;
    }
DetailActivity.java 文件源码 项目:ZhidaoDaily-android 阅读 25 收藏 0 点赞 0 评论 0
private Bitmap captureWebViewall(WebView webView) {
    Picture snapShot = webView.capturePicture();
    Bitmap bmp = Bitmap.createBitmap(snapShot.getWidth(),
            snapShot.getHeight(), Bitmap.Config.ARGB_8888);
    Canvas canvas = new Canvas(bmp);
    snapShot.draw(canvas);
    return bmp;
}
GraphicsCache.java 文件源码 项目:TreebolicLib 阅读 25 收藏 0 点赞 0 评论 0
public GraphicsCache(@SuppressWarnings("unused") final Component component, @NonNull final Graphics thatGraphics, final int width0, final int height0)
{
    this.canvas = thatGraphics.canvas;
    if (GraphicsCache.CACHE)
    {
        this.picture = new Picture();
        this.width = width0;
        this.height = height0;
    }
    else
    {
        this.picture = null;
        this.width = 0;
        this.height = 0;
    }
}
ReactWebViewManager.java 文件源码 项目:RNLearn_Project1 阅读 24 收藏 0 点赞 0 评论 0
private WebView.PictureListener getPictureListener() {
  if (mPictureListener == null) {
    mPictureListener = new WebView.PictureListener() {
      @Override
      public void onNewPicture(WebView webView, Picture picture) {
        dispatchEvent(
          webView,
          new ContentSizeChangeEvent(
            webView.getId(),
            webView.getWidth(),
            webView.getContentHeight()));
      }
    };
  }
  return mPictureListener;
}
ReactWebViewManager.java 文件源码 项目:RNLearn_Project1 阅读 30 收藏 0 点赞 0 评论 0
private WebView.PictureListener getPictureListener() {
  if (mPictureListener == null) {
    mPictureListener = new WebView.PictureListener() {
      @Override
      public void onNewPicture(WebView webView, Picture picture) {
        dispatchEvent(
          webView,
          new ContentSizeChangeEvent(
            webView.getId(),
            webView.getWidth(),
            webView.getContentHeight()));
      }
    };
  }
  return mPictureListener;
}
SVGParser.java 文件源码 项目:ZzBeeLayout 阅读 23 收藏 0 点赞 0 评论 0
private static SVG parse(InputStream in, Integer searchColor, Integer replaceColor, boolean whiteMode,
                             int targetWidth, int targetHeight) throws SVGParseException {
//        Util.debug("Parsing SVG...");
        try {
            long start = System.currentTimeMillis();
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();
            final Picture picture = new Picture();
            SVGHandler handler = new SVGHandler(picture, targetWidth, targetHeight);
            handler.setColorSwap(searchColor, replaceColor);
            handler.setWhiteMode(whiteMode);
            xr.setContentHandler(handler);
            xr.parse(new InputSource(in));
//        Util.debug("Parsing complete in " + (System.currentTimeMillis() - start) + " millis.");
            SVG result = new SVG(picture, handler.bounds);
            // Skip bounds if it was an empty pic
            if (!Float.isInfinite(handler.limits.top)) {
                result.setLimits(handler.limits);
            }
            return result;
        } catch (Exception e) {
            throw new SVGParseException(e);
        }
    }
ReactWebViewManager.java 文件源码 项目:Ironman 阅读 30 收藏 0 点赞 0 评论 0
private WebView.PictureListener getPictureListener() {
  if (mPictureListener == null) {
    mPictureListener = new WebView.PictureListener() {
      @Override
      public void onNewPicture(WebView webView, Picture picture) {
        dispatchEvent(
          webView,
          new ContentSizeChangeEvent(
            webView.getId(),
            webView.getWidth(),
            webView.getContentHeight()));
      }
    };
  }
  return mPictureListener;
}
RNX5WebViewManager.java 文件源码 项目:react-native-x5 阅读 23 收藏 0 点赞 0 评论 0
private WebView.PictureListener getPictureListener() {
    if (mPictureListener == null) {
        mPictureListener = new WebView.PictureListener() {
            @Override
            public void onNewPicture(WebView webView, Picture picture) {
                dispatchEvent(
                        webView,
                        new ContentSizeChangeEvent(
                                webView.getId(),
                                webView.getWidth(),
                                webView.getContentHeight()));
            }
        };
    }
    return mPictureListener;
}
MapOverlay.java 文件源码 项目:ExhibitionCenter 阅读 59 收藏 0 点赞 0 评论 0
public void setData(Picture floorMap)
{
    this.floorMap = floorMap;
    if (this.mapMainView.getWidth() == 0)
    {
        ViewTreeObserver vto = this.mapMainView.getViewTreeObserver();
        vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener()
        {
            public boolean onPreDraw()
            {
                if (!hasMeasured)
                {
                    calcRatio();
                }
                return true;
            }
        });
    }
    else
    {
        calcRatio();
    }
}
MapLayer.java 文件源码 项目:MapView 阅读 27 收藏 0 点赞 0 评论 0
public void setImage(Picture image) {
    this.image = image;

    if (mapView.getWidth() == 0) {
        ViewTreeObserver vto = mapView.getViewTreeObserver();
        vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
            public boolean onPreDraw() {
                if (!hasMeasured) {
                    initMapLayer();
                    hasMeasured = true;
                }
                return true;
            }
        });
    } else {
        initMapLayer();
    }
}
SVG.java 文件源码 项目:stepik-android 阅读 32 收藏 0 点赞 0 评论 0
/**
 * 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;
}
SVGParser.java 文件源码 项目:PdDroidPublisher 阅读 24 收藏 0 点赞 0 评论 0
private static SVG parse(InputStream in, Integer searchColor, Integer replaceColor, boolean whiteMode) throws SVGParseException {
//        Util.debug("Parsing SVG...");
        try {
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();
            final Picture picture = new Picture();
            SVGHandler handler = new SVGHandler(picture);
            handler.setColorSwap(searchColor, replaceColor);
            handler.setWhiteMode(whiteMode);
            xr.setContentHandler(handler);
            xr.parse(new InputSource(in));
//        Util.debug("Parsing complete in " + (System.currentTimeMillis() - start) + " millis.");
            SVG result = new SVG(picture, handler.bounds);
            // Skip bounds if it was an empty pic
            if (!Float.isInfinite(handler.limits.top)) {
                result.setLimits(handler.limits);
            }
            return result;
        } catch (Exception e) {
            throw new SVGParseException(e);
        }
    }
RenderProgram.java 文件源码 项目:ametro 阅读 25 收藏 0 点赞 0 评论 0
private List<DrawingElement> createElementsTree(MapContainer container, String schemeName) {
    final List<DrawingElement> elements = new ArrayList<>();
    MapScheme scheme = container.getScheme(schemeName);
    for (MapSchemeLine line : scheme.getLines()) {
        createLine(elements, scheme, line);
    }
    for (MapSchemeTransfer transfer : scheme.getTransfers()) {
        createTransfer(elements, scheme, transfer);
    }
    for (String imageName : scheme.getImageNames()) {
        Object background = scheme.getBackgroundObject(imageName);
        if (background instanceof Picture) {
            elements.add(new PictureBackgroundElement(scheme, (Picture) background));
        } else if (background instanceof Bitmap) {
            elements.add(new BitmapBackgroundElement(scheme, (Bitmap) background));
        }
    }
    return elements;
}
PictureBitmapTextureAtlasSource.java 文件源码 项目:AndroidCourses 阅读 27 收藏 0 点赞 0 评论 0
@Override
public Bitmap onLoadBitmap(final Config pBitmapConfig) {
    final Picture picture = this.mPicture;
    if (picture == null) {
        Debug.e("Failed loading Bitmap in " + this.getClass().getSimpleName() + ".");
        return null;
    }

    final Bitmap bitmap = Bitmap.createBitmap(this.mTextureWidth, this.mTextureHeight, pBitmapConfig);
    final Canvas canvas = new Canvas(bitmap);

    final float scaleX = (float)this.mTextureWidth / this.mPicture.getWidth();
    final float scaleY = (float)this.mTextureHeight / this.mPicture.getHeight();
    canvas.scale(scaleX, scaleY, 0, 0);

    picture.draw(canvas);

    return bitmap;
}
PictureBitmapTextureAtlasSource.java 文件源码 项目:AndroidCourses 阅读 21 收藏 0 点赞 0 评论 0
@Override
public Bitmap onLoadBitmap(final Config pBitmapConfig) {
    final Picture picture = this.mPicture;
    if (picture == null) {
        Debug.e("Failed loading Bitmap in " + this.getClass().getSimpleName() + ".");
        return null;
    }

    final Bitmap bitmap = Bitmap.createBitmap(this.mTextureWidth, this.mTextureHeight, pBitmapConfig);
    final Canvas canvas = new Canvas(bitmap);

    final float scaleX = (float)this.mTextureWidth / this.mPicture.getWidth();
    final float scaleY = (float)this.mTextureHeight / this.mPicture.getHeight();
    canvas.scale(scaleX, scaleY, 0, 0);

    picture.draw(canvas);

    return bitmap;
}
PictureBitmapTextureAtlasSource.java 文件源码 项目:ClassicF1 阅读 21 收藏 0 点赞 0 评论 0
@Override
public Bitmap onLoadBitmap(final Config pBitmapConfig) {
    final Picture picture = this.mPicture;
    if(picture == null) {
        Debug.e("Failed loading Bitmap in " + this.getClass().getSimpleName() + ".");
        return null;
    }

    final Bitmap bitmap = Bitmap.createBitmap(this.mTextureWidth, this.mTextureHeight, pBitmapConfig);
    final Canvas canvas = new Canvas(bitmap);

    final float scaleX = (float)this.mTextureWidth / this.mPicture.getWidth();
    final float scaleY = (float)this.mTextureHeight / this.mPicture.getHeight();
    canvas.scale(scaleX, scaleY, 0, 0);

    picture.draw(canvas);

    return bitmap;
}
PictureBitmapTextureAtlasSource.java 文件源码 项目:tilt-game-android 阅读 23 收藏 0 点赞 0 评论 0
@Override
public Bitmap onLoadBitmap(final Config pBitmapConfig) {
    final Picture picture = this.mPicture;
    if (picture == null) {
        Debug.e("Failed loading Bitmap in " + this.getClass().getSimpleName() + ".");
        return null;
    }

    final Bitmap bitmap = Bitmap.createBitmap(this.mTextureWidth, this.mTextureHeight, pBitmapConfig);
    final Canvas canvas = new Canvas(bitmap);

    final float scaleX = (float)this.mTextureWidth / this.mPicture.getWidth();
    final float scaleY = (float)this.mTextureHeight / this.mPicture.getHeight();
    canvas.scale(scaleX, scaleY, 0, 0);

    picture.draw(canvas);

    return bitmap;
}
PlayPauseDrawable.java 文件源码 项目:PlayPauseDrawable 阅读 32 收藏 0 点赞 0 评论 0
@Override
public void draw(Canvas canvas) {

    canvas.drawCircle(mBounds.centerX(), mBounds.centerY(), mBounds.centerX(), mBackgroundPaint);
    Picture picture = new Picture() ;
    picture.draw(canvas);
    canvas.save();
    canvas.rotate(180 * mRotation, (x(0) + x(1))/2, (y(0) + y(1))/2);
    canvas.drawLine(x(0), y(0), x(1), y(1), mLinePaint);
    canvas.restore();

    canvas.save();
    canvas.rotate(180 * mRotation, (x(2) + x(3)) / 2, (y(2) + y(3)) / 2);
    canvas.drawLine(x(2), y(2), x(3), y(3), mLinePaint);
    canvas.restore();

    canvas.save();
    canvas.rotate(180 * mRotation, (x(4) + x(5)) / 2, (y(4) + y(5)) / 2);
    canvas.drawLine(x(4), y(4), x(5), y(5), mLinePaint);
    canvas.restore();

}
SVG.java 文件源码 项目:XDroidAnimation 阅读 27 收藏 0 点赞 0 评论 0
/**
 * 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;
}
PictureTextureSource.java 文件源码 项目:itmarry 阅读 20 收藏 0 点赞 0 评论 0
@Override
public Bitmap onLoadBitmap(final Config pBitmapConfig) {
    final Picture picture = this.mPicture;
    if(picture == null) {
        Debug.e("Failed loading Bitmap in PictureTextureSource.");
        return null;
    }

    final Bitmap bitmap = Bitmap.createBitmap(this.mWidth, this.mHeight, pBitmapConfig);
    final Canvas canvas = new Canvas(bitmap);

    final float scaleX = (float)this.mWidth / this.mPicture.getWidth();
    final float scaleY = (float)this.mHeight / this.mPicture.getHeight();
    canvas.scale(scaleX, scaleY, 0, 0);

    picture.draw(canvas);

    return bitmap;
}
PictureBitmapTextureAtlasSource.java 文件源码 项目:30-android-libraries-in-30-days 阅读 19 收藏 0 点赞 0 评论 0
@Override
public Bitmap onLoadBitmap(final Config pBitmapConfig) {
    final Picture picture = this.mPicture;
    if(picture == null) {
        Debug.e("Failed loading Bitmap in " + this.getClass().getSimpleName() + ".");
        return null;
    }

    final Bitmap bitmap = Bitmap.createBitmap(this.mTextureWidth, this.mTextureHeight, pBitmapConfig);
    final Canvas canvas = new Canvas(bitmap);

    final float scaleX = (float)this.mTextureWidth / this.mPicture.getWidth();
    final float scaleY = (float)this.mTextureHeight / this.mPicture.getHeight();
    canvas.scale(scaleX, scaleY, 0, 0);

    picture.draw(canvas);

    return bitmap;
}
SmartWebView.java 文件源码 项目:appdeck-android 阅读 23 收藏 0 点赞 0 评论 0
@Override
public void onNewPicture(WebView view, Picture arg1)
{
    // put code here that needs to run when the page has finished loading and
    // a new "picture" is on the webview.      

    if (shouldSrollToX != -1 && shouldSrollToX != -1)
    {
        view.scrollTo(shouldSrollToX, shouldSrollToY);
        shouldSrollToX = -1;
        shouldSrollToY = -1;
    }

    if (onNewPictureCalled == false)
    {
        root.progressSet(view, 101);
        onNewPictureCalled = true;
    }
    //root.webviewIsReady(this);

}
PXImagePaint.java 文件源码 项目:pixate-freestyle-android 阅读 19 收藏 0 点赞 0 评论 0
public void applyFillToPath(Path path, Paint paint, Canvas context) {
    context.save();
    // clip to path
    context.clipPath(path);
    // do the gradient
    Rect bounds = new Rect();
    context.getClipBounds(bounds);
    Picture image = imageForBounds(bounds);
    // draw
    if (image != null) {
        // TODO - Blending mode? We may need to convert the Picture to a
        // Bitmap and then call drawBitmap
        context.drawPicture(image);
    }
    context.restore();
}
Purity.java 文件源码 项目:cordova-amazon-fireos 阅读 20 收藏 0 点赞 0 评论 0
public boolean checkRenderView(AmazonWebView view)
{
    if(state == null)
    {
        setBitmap(view);
        return false;
    }
    else
    {
        Picture p = view.capturePicture();
        Bitmap newState = Bitmap.createBitmap(p.getWidth(), p.getHeight(), Bitmap.Config.ARGB_8888);
        boolean result = newState.equals(state);
        newState.recycle();
        return result;
    }
}
SVGParser.java 文件源码 项目:UltimateAndroid 阅读 29 收藏 0 点赞 0 评论 0
private static SVG parse(InputStream in, Integer searchColor, Integer replaceColor, boolean whiteMode,
                             int targetWidth, int targetHeight) throws SVGParseException {
//        Util.debug("Parsing SVG...");
        try {
            long start = System.currentTimeMillis();
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();
            final Picture picture = new Picture();
            SVGHandler handler = new SVGHandler(picture, targetWidth, targetHeight);
            handler.setColorSwap(searchColor, replaceColor);
            handler.setWhiteMode(whiteMode);
            xr.setContentHandler(handler);
            xr.parse(new InputSource(in));
//        Util.debug("Parsing complete in " + (System.currentTimeMillis() - start) + " millis.");
            SVG result = new SVG(picture, handler.bounds);
            // Skip bounds if it was an empty pic
            if (!Float.isInfinite(handler.limits.top)) {
                result.setLimits(handler.limits);
            }
            return result;
        } catch (Exception e) {
            throw new SVGParseException(e);
        }
    }
SVGParser.java 文件源码 项目:UltimateAndroid 阅读 26 收藏 0 点赞 0 评论 0
private static SVG parse(InputStream in, Integer searchColor, Integer replaceColor, boolean whiteMode,
                             int targetWidth, int targetHeight) throws SVGParseException {
//        Util.debug("Parsing SVG...");
        try {
            long start = System.currentTimeMillis();
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();
            final Picture picture = new Picture();
            SVGHandler handler = new SVGHandler(picture, targetWidth, targetHeight);
            handler.setColorSwap(searchColor, replaceColor);
            handler.setWhiteMode(whiteMode);
            xr.setContentHandler(handler);
            xr.parse(new InputSource(in));
//        Util.debug("Parsing complete in " + (System.currentTimeMillis() - start) + " millis.");
            SVG result = new SVG(picture, handler.bounds);
            // Skip bounds if it was an empty pic
            if (!Float.isInfinite(handler.limits.top)) {
                result.setLimits(handler.limits);
            }
            return result;
        } catch (Exception e) {
            throw new SVGParseException(e);
        }
    }
WebImage.java 文件源码 项目:NeXT_pyp 阅读 28 收藏 0 点赞 0 评论 0
private void delaySetup() {

        wv.setPictureListener(new PictureListener() {

            @Override
            public void onNewPicture(WebView view, Picture picture) {
                wv.setPictureListener(null);
                setup();
            }

        });

        // wv.setInitialScale(100);
        wv.loadData("<html></html>", "text/html", "utf-8");
        wv.setBackgroundColor(color);

    }
WebImage.java 文件源码 项目:NeXT_pyp 阅读 25 收藏 0 点赞 0 评论 0
private void delaySetup() {

        wv.setPictureListener(new PictureListener() {

            @Override
            public void onNewPicture(WebView view, Picture picture) {
                wv.setPictureListener(null);
                setup();
            }

        });

        // wv.setInitialScale(100);
        wv.loadData("<html></html>", "text/html", "utf-8");
        wv.setBackgroundColor(color);

    }
SVGParser.java 文件源码 项目:egg-android 阅读 28 收藏 0 点赞 0 评论 0
private static SVG parse(InputStream in, Integer searchColor, Integer replaceColor, boolean whiteMode,
                             int targetWidth, int targetHeight) throws SVGParseException {
//        Util.debug("Parsing SVG...");
        try {
            long start = System.currentTimeMillis();
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();
            final Picture picture = new Picture();
            SVGHandler handler = new SVGHandler(picture, targetWidth, targetHeight);
            handler.setColorSwap(searchColor, replaceColor);
            handler.setWhiteMode(whiteMode);
            xr.setContentHandler(handler);
            xr.parse(new InputSource(in));
//        Util.debug("Parsing complete in " + (System.currentTimeMillis() - start) + " millis.");
            SVG result = new SVG(picture, handler.bounds);
            // Skip bounds if it was an empty pic
            if (!Float.isInfinite(handler.limits.top)) {
                result.setLimits(handler.limits);
            }
            return result;
        } catch (Exception e) {
            throw new SVGParseException(e);
        }
    }
SVGParser.java 文件源码 项目:our_days 阅读 25 收藏 0 点赞 0 评论 0
private static SVG parse(InputStream in, Integer searchColor, Integer replaceColor, boolean whiteMode,
                             int targetWidth, int targetHeight) throws SVGParseException {
//        Util.debug("Parsing SVG...");
        try {
            long start = System.currentTimeMillis();
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();
            final Picture picture = new Picture();
            SVGHandler handler = new SVGHandler(picture, targetWidth, targetHeight);
            handler.setColorSwap(searchColor, replaceColor);
            handler.setWhiteMode(whiteMode);
            xr.setContentHandler(handler);
            xr.parse(new InputSource(in));
//        Util.debug("Parsing complete in " + (System.currentTimeMillis() - start) + " millis.");
            SVG result = new SVG(picture, handler.bounds);
            // Skip bounds if it was an empty pic
            if (!Float.isInfinite(handler.limits.top)) {
                result.setLimits(handler.limits);
            }
            return result;
        } catch (Exception e) {
            throw new SVGParseException(e);
        }
    }


问题


面经


文章

微信
公众号

扫码关注公众号