⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 svgimagecanvas.java

📁 j2me手机应用开发环境下的svg动画程序
💻 JAVA
字号:
/* * * Copyright © 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */package com.sun.perseus.demo;import javax.microedition.lcdui.Canvas;import javax.microedition.lcdui.Graphics;import javax.microedition.m2g.SVGImage;import javax.microedition.m2g.ScalableGraphics;class SVGImageCanvas extends Canvas {    /**     * The SVGImage painted by the canvas.     */    protected SVGImage svgImage;    /**     * The ScalableGraphics used to paint into the midp     * Graphics instance.     */    protected ScalableGraphics sg = ScalableGraphics.createInstance();    /**     * @param svgImage the SVGImage this canvas should paint.     */    protected SVGImageCanvas(final SVGImage svgImage) {        this.svgImage = svgImage;    }    public void paint(Graphics g) {        g.setColor(255, 255, 255);        g.fillRect(0, 0, getWidth(), getHeight());        sg.bindTarget(g);        svgImage.setViewportWidth(getWidth());        svgImage.setViewportHeight(getHeight());        sg.render(0, 0, svgImage);        sg.releaseTarget();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -