×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    7

    adding svg on custom canvas

    can i do this?

    this is the way i add a svg in a canvas..
    Code:
            SVGAnimator mapCanvasAnimator = DefaultSVGAnimator.createAnimator(svgImage);
            Canvas mapCanvas =  (Canvas)mapCanvasAnimator.getTargetComponent();
            display.setCurrent(mapCanvas);
    when i tried doing this to a custom canvas, i get an error...
    Please help

  2. #2
    Registered User
    Join Date
    Sep 2007
    Posts
    20

    Re: adding svg on custom canvas

    yes, by adding the svg on the canvas itself


    ScalableGraphics sg;

    public void paint(Graphics g) {
    // *** clear the display
    g.setColor(255, 255, 255);
    g.fillRect(0, 0, getWidth(), getHeight());

    // *** render the SVG image
    sg.bindTarget(g);
    sg.setTransparency(1f);
    sg.render(0, 0, svgImage);
    sg.releaseTarget();
    }

Similar Threads

  1. 2 svg in 1 canvas?
    By mental_boi in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-10-07, 21:03
  2. Major problem with delegation to Canvas
    By bartekn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2003-10-08, 17:46
  3. TinyLine SVG Minute Toolkit: Optimizing SVG for J2ME
    By girow in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-05-05, 18:44
  4. TinyLine SVG Minute Toolkit for J2ME: version 1.4 released
    By girow in forum Mobile Java General
    Replies: 0
    Last Post: 2003-05-05, 16:25
  5. adding custom controls to a form in runtime
    By Atyauristen in forum Symbian User Interface
    Replies: 0
    Last Post: 2002-10-11, 07:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •