Use SVGAnimator to display a SVG with xlink PNG image

I tried the M2GDemo and it works without this image part
SVGAnimator animator =
SVGAnimator.createAnimator( image );
// add our custom event listener
animator.setSVGEventListener(
new CustomEventListener( image, animator ) );
// get the Canvas for this player: requires a cast
Canvas canvas = (Canvas) animator.getTargetComponent();
I modify the requestResource a bit to get Image from root1.
public void requestResource(ScalableImage inImage, String inURI)
     int pos = inURI.indexOf(":");
     if (pos >0){
          inURI = inURI.substring(pos);
     inURI = "file:///root1/"+inURI;
try
Connector.openInputStream(inURI);
catch ( IOException ioe )
ioe.printStackTrace();
<image x='90.0' y='69.46001' width='222.7' height='152.25' xlink:href='myImage.png'/>
Now I stuck with the error below.
Using Pisces Renderer (native version)
loadStarting : true
loadComplete : true
loadingFailed: false
loadStarting : true
loadComplete : true
loadingFailed: falsejava.lang.ArrayIndexOutOfBoundsException
     at com.sun.perseus.model.Text.applyXMLSpaceDefault(+86)
     at com.sun.perseus.model.Text.applyXMLSpace(+37)
     at com.sun.perseus.model.Text.layoutText(+70)
     at com.sun.perseus.model.Text.checkLayout(+13)
     at com.sun.perseus.model.Text.paint(+12)
     at com.sun.perseus.model.ModelNode.paint(+9)
     at com.sun.perseus.model.StructureNode.paint(+16)
     at com.sun.perseus.model.ModelNode.paint(+9)
     at com.sun.perseus.model.StructureNode.paint(+16)
     at com.sun.perseus.model.ModelNode.paint(+9)
     at com.sun.perseus.model.DocumentNode.paint(+16)
     at com.sun.perseus.model.SimpleCanvasManager.fullPaint(+108)
     at com.sun.perseus.model.SimpleCanvasManager.updateCanvas(+18)
     at com.sun.perseus.midp.SVGCanvas$1.run(+87)
     at com.sun.perseus.util.RunnableQueue.run(+271)
RunnableQueue terminatingUncaught exception java/lang/ArrayIndexOutOfBoundsException.
Bascially all I need is a viewer to display SVG with xlink to PNG image without the use or tinyline. If I want to get the PNG image from http, what should I do?
Any response will be greatly appreciated.

> This technique is really just using a BEE, there is
> documentation on the BEE concept in the online help
> and Brian McKellar has a weblog on the subject as
> well.
OK, I think I get the idea. Will check the stuff. Thanks.
> Notice the strange D at the end of the line. This
> isn't in the original posting. Perhaps this is just
> bad cut and paste.
Just bad copy paste. Yes.
> You say that this isn't working for you - but you
> don't describe the results. Is there an error?  Does
> it render anything in the button at all?  Does the
> raw HTML get rendered?
I just saw coding in the button.
> You want to make sure that the
> text doesn't get encoded - which would cause the HTML
> source to display instead. On the htmlb:button you
> will want to set the attribute encode = FALSE.
OK, that was right on spot. This shows me the Icon! Strike!
> Also I am not sure that you can also pass in text
> with the image like that.  You might have to create a
> full BEE and add the image and a textView separately
> into the BEE.  Then render the entire BEE to a string.
I'll check the documentation on BEE and give it a try.
Thanks for your answer.
Thats a starting point for me.
Alf

Similar Messages

  • I am using a mini display to hdmi with my macbook and the display works fine. However, the sound will only play iTunes such as music and movies but when i go online to watch movies on youtube it will not play any sound. Please help

    I am using a mini display to hdmi with my macbook and the display works fine. However, the sound will only play iTunes such as music and movies but when i go online to watch movies on youtube it will not play any sound. Please help

    HDCP maybe? Read this http://www.macnn.com/articles/08/11/26/displayport.drm.conflict/

  • Fail to use Jeditorpane to display a text with big5 encoding

    Hi All,
    I fail to use Jeditorpane to display a text with big5 encoding correctly.
    It only show machine code.
    I am using jre1.6.0_17. Yet it works well with earlier version of jre like jre 1.6.0_15, and jre 1.6.0_16
    bcpscsin

    bcpscsin wrote:
    ..I can find it in javax.swing
    FFS! It is JEditorPane, not Jeditorpane. Count the freaking upper case letters in both of those!
    Convince yourself by following these two URLs
    [http://java.sun.com/javase/6/docs/api/javax/swing/JEditorPane.html] -> produces a web page.
    [http://java.sun.com/javase/6/docs/api/javax/swing/Jeditorpane.html] -> "Page Not Found"
    My point is - do not type 'something like' the class name - get it right so we can be sure. Programming is a technical business and programmers need to be very accurate. It is even more important to be very accurate when asking for help on an forum. People have very little time to 'hold your hand' about the correct spelling and capitalisation of class names - or anything else for that matter.
    You still have not answered my question about the bug database.

  • Firefox asks what to do with some PNG images instead of just displaying them

    Not sure what is going on here, but some PNG images seem to confuse Firefox, while others are fine. While some PNGs just display when clicked on (eg: when wanting to see a full size image from a thumbnail), others make Firefox ask what I want to do with it. When I select "Firefox 3.6.8" it ends with an error:
    /tmp/elementary_gtk_theme_by_DanRabbit-1.png could not be opened, because an unknown error occurred.
    Try saving to disk first and then opening the file.
    ... but when I manually made it open with "/usr/bin/firefox" (I'm in Ubuntu) the image opens fine. I was beginning to think this was now universal for PNGs, but I was opening offending ones from the same site, and going elsewhere showed that some PNGs will be displayed as usual. Does anyone have any idea why this would happen to some PNGs but not all? Here is a link to one of the problem PNGs:
    http://s.linux-mag.com/i/articles/7811/elementary_gtk_theme_by_DanRabbit.png
    It opens without issue in Opera. Hope someone can make sense of this. Cheers

    You can look at this extension:
    *Open in Browser: https://addons.mozilla.org/firefox/addon/8207

  • Transparency not working on smartshape button filled with transparent (PNG) image.

    I'm using Captivate 8 and have had no problems so far importing PNG images with transparent backgrounds.....that is until I try and make a smartshape button and import a transparent PNG image as the background.
    It displays fine on screen, but whenever I preview it or publish, the white background of the image/button displays. Is this a known Captivate 8 limitation?
    Sorry if this is a repeated question....I've tried trawling through the forums and all I can see is to try different file formats for the images, such as GIF or BMP, which I've tried and nothing works.
    Any advice or suggestions?

    If it is a button, what is inserted for Rollover and Down state? I just recreated a shape button, with three different images for the states. All are in one PS-file as layers which I imported into Captivate. I kept Stretched checked in this case, because I know there is sometimes a slight change in size between states. Here are screenshots of Up, Rollover and Down state. The stroke was set to 0 for the shape, but to prevent all color contamination I also set stroke to the color of the background (light grey). In the first (Up) image you can clearly see where the stroke is due to truncation of the Question mark.
    Seems only possibility is in the creation of the PNG's? What was your work flow?

  • Problem with CFimage / PNG images

    I have a problem saving PNG images from another server, for example itunes, some work, some don't
    The following image will open fine in my browser ->
    http://a576.phobos.apple.com/us/r30/Purple/v4/de/60/bb/de60bb7f-8995-4007-cfec-1b0a472fa36 7/icon.png
    This is the error I am receiving:
    An exception occurred while trying to read the image.
    javax.imageio.IIOException: Error reading PNG metadata
    Code:
    <cfimage source="http://a576.phobos.apple.com/us/r30/Purple/v4/de/60/bb/de60bb7f-8995-4007-cfec-1b0a472fa36 7/icon.png" overwrite="true"  destination="#filepath#/9999.png"
        action = "write">
    I believe some images have malformed/incorrect headers. I'm guessing this is a CF issue (I use CF8), because it loads fine in a browser.
    Anybody have a solution to this? Maybe an alternative way to retrieve the image? Custom tag?
    Thanks
    Mark

    I found the issue and solution. The problem was with the Java, the JVM had issues reading SOME PNG's from servers, but not all, there must be a newer way of encoding them that was not around when the version of java I had was created, or it's just a bug. I had an earlier version of 1.6 which is downloaded as version SE 6 from Oracle.
    As per some instructions by Ben Forta I tried an update of the JVM to version 7 (1.7.x),
    http://forta.com/blog/index.cfm/2013/3/3/Upgrading-ColdFusion-To-Java-7
    The update worked on my local dev machine which was CF8 with Win 7 64bit, and it actually fixed the CFIMAGE issue!
    However, when I did the same update, with the same java file on the same version of CF8, CF would no longer restart throwing an error that it could not find a file.
    Luckily I had a backup of the config file because I could not switch settings back any other way if CF would not start the administrator (Java also makes a .BAK anyway)
    I tried the first build of version 7, same problem, so I went to the very last version 6, build 45, it installed, and it also fixed the CFIMAGE crash!
    A couple of points for anybody else trying this
    Make sure you have a back up the config, in CF8 it's located here (different to the location in Bens instructions)
    Coldfusion8\runtime\bin\jvm.config
    Also note that the forward and backward slashes are different for the built in JVM that ships with CF and is set in the administrator, and the location you will specify
    Original location: C:/ColdFusion8/runtime/jre
    New location: C:\Program Files\Java\jre7\
    Here is the location to the Java file (
    Java SE Runtime Environment 6u45)
    Java Archive Downloads - Java SE 6
    Took me days to get to the bottom of this, but the fix actually takes just a few simple steps and a few minutes, of course
    Mark

  • Using iMac as display from Mini with Windows 7

    Have a Mac Mini with Bootcamp and Windows 7 SP1. When it was intially installed, it was attached to an iMac with a thunderbolt cable and Command-F2 worked to switch the display over. However Windows on the Mini then downloaded and installed all the various patches, and now Command-F2 doesn't do anything. Can anyone shed any light on this?

    Hello Allan,
    I appreciate your response. I have read that a Mac running Windows with Bootcamp can use TDM, so I expected it would be a matter of installing proper drivers, but, unless anybody else has had some success, I think I'm about ready to admit defeat.
    I appreciate you proposing a software solution, however, ScreenRecycler only supports using a Windows PC as another display, not the other way around. I did play around with a couple other software solutions, but none of these solutions would work well once my work PC is connected to VPN.
    I guess I'll continue to work off a small laptop screen while a giant 27-inch screen on the same desk goes unused. Very frustrating.

  • Using 10.6 NetBoot v1.0 with Tiger client images on PPC tray-loading iMacs

    Hi all - I'm a bit confused over some documentation I'm reading. I'm reviewing the "System Imaging and SW Update Admin" guide for Snow Leopard Server (available at http://images.apple.com/server/macosx/docs/SystemImaging_and_SW_Update_Adminv10.6.pdf) and am puzzled on a few things.
    We have several older tray-loading iMacs that currently have client images served up from an old Xserve running OS X Server (Tiger). In the first part of the guide, I saw that the Snow Leopard System Image utility would not work for creating images from older PPC-based systems. However, later in the guide it refers to enable NetBoot 1.0 (which can run alongside NetBoot 2.0) for older clients - specifically including the tray-loading iMac.
    So my question is, how can I go about retiring the old Xserve and still serve/maintain these Tiger client images on Snow Leopard Server?
    Can I simply copy the images to the share point in the new Snow Leopard Server and enable NetBoot 1.0? Would I need to create a new image (using the Snow Leopard Server System Image Utility) that starts from a source Tiger installation disc and then add appropriate software as packages? Or can I simply use those existing images (with what I presume means software cannot be added) and serve them up on Snow Leopard Server?
    Basically, I have those tray-loading iMacs running a fairly minimal setup (base operating system, ability to join to our LDAP server, and very lightweight open source programs). As (if) they die, we are replacing them with newer Intel-based systems. Having said that, there are still at least 9 or so of these tray-loading iMacs quietly humming along with no indication of failure in the near future (nice job, Apple). It's not a problem if I cannot add software to the images (as it seems most software would require Leopard anyway) - but I would like to serve these up on the network. Any thoughts/ideas?

    You can copy your existing images to the 10.6 server, enable NetBoot 1.0, and they will be served up just fine. The only thing you would need 10.4 server for is to create new images.

  • When I connect my Macbook air to my TV, using a Mini Display Port/HDMl adaptor and an HDMl cable, the only thing that appears on the TV screen is the Air's background screen,

    When I connect my Macbook Air to my TV via the thunderbolt outlet and using a Mini Display Port/HDMl adaptor, the only image that appears on the TV screen is that of my Air background. There is obviously a signal getting through to the TV, but it is not sending images of anything else, and am unable to watch video through my Air. Any advise/suggestions?

    This is called "extended desktop mode".  It's an extension of the desktop off to the right (by default) of your MBair screen.  Grab an app and drag it off the right side of your MBair screen and it will appear on the TV.
    To mirror your MBair screen on the TV you can press Command F1.  This will toogle between mirror and extended desktop.
    You can find all the settings in System Preferences > Displays > Arrangement tab.
    Regards,
    Captfred

  • Graphics, ImageIO, and 32-bit PNG images with alpha-channels

    I have a series of 32-bit PNG images, all with alpha channels. I'm using ImageIO.read(File) : BufferedImage to read the PNG image into memory.
    When I call graphics.drawImage( image, 0, 0, null ); I see the image drawn, however all semi-transparent pixels have a black background, only 100% transparent pixels in the source image are transparent in the drawn image.
    The Graphics2D instance I'm drawing to is obtained from a BufferStrategy instance (I'm painting onto an AWT Canvas).
    Here's my code:
    Loading the image:
    public static BufferedImage getEntityImage(String nom, String state) {
              if( _entityImages.containsKey(nom) ) return _entityImages.get( nom );
              String path = "Entities\\" + nom + "_" + state + ".png";
              try {
                   BufferedImage image = read( path );
                   if( image != null ) _entityImages.put( nom, image );
                   return image;
              } catch(IOException iex) {
                   iex.printStackTrace();
                   return null;
         private static BufferedImage read(String fileName) throws IOException {
              fileName = Program.contentPath + fileName;
              File file = new File( fileName );
              if( !file.exists() ) return null;
              return ImageIO.read( new File( fileName ) );
         }Using the image:
    Graphics2D g = (Graphics2D)_bs.getDrawGraphics();
    g.setRenderingHint( RenderingHints.KEY_ANTIALIASING , RenderingHints.VALUE_ANTIALIAS_ON);
    public @Override void render(RenderContext r) {
              Point p = r.v.translateWorldPointToViewportPoint( getLoc() );
              int rad = getRadius();
              int x = (int) p.x - (rad / 2);
              int y = (int) p.y - (rad / 2);
              BufferedImage image = Images.getEntityImage( getCls(), "F" );
              r.g.drawImage( image, x, y, null );
         }

    You may want to check on you system and see what ImageReaders are available, it could be ImageIO is just not picking the best one, if not, then you can use getImageReaders to get an iterator of image readers, then choose the more appropriate one.

  • How do I replace images in slideshow with retina resolution images?

    When I use a retina.js script to replace .png images with @2x.png images in a slideshow, only the first image shown is replaced with retina res image. Is there a way to replace all?

    You can use CSS to make the other images retina. You need to downlaod the index.css file from the CSS folder then add code to it that has the width and height of the scaled down image like this:
    /* Slide 3 home */
    img#u9095_img.block {
              width: 490px;
              height: 506px;
    I have got it working but for some reason the images seem to inconsistantly show in my browsers. See how it works for you.

  • How do i use an external display with my macbook pro?

    How do I use an external display with a macbook pro?

    Just buy the proper adapter cord, such as MiniDisplay port to HDMI for example.  Plug it in and it will be automatically recognized.  Use System Preferences > Displays to set options.
    The display can Mirror your primary desktop or Extend the Desktop.
    Regards,
    Captfred

  • How do I use my Studio Display with my macbook while closed?

    Just wondering if its possible to use my stuidio dispaly and an external keyboard & mouse while my macbook is closed, and if so how do I do that?

    In System Preferences>Display on the MacBook screen there should be an Arrangement tab when you have the MacBook hooked up to the monitor and both screens working. When you click the Arrangement tab do you see two monitors side by side? One of them will have a Menu Bar at the top. Just click on the Menu Bar and drag it to the second monitor. That will make the second monitor your main screen. You can now use your MacBook in Clamshell Mode with a wired or Bluetooth keyboard and mouse.  http://support.apple.com/kb/HT3131  When you disconnect from the monitor your Menu Bar will automatically change back to the MacBook.

  • Help using a mini display port to HDMI cable with MacBook Air and TV

    Hi, Apple gurus. I need help setting up my MacBook Air to my Vizio TV using a mini display port to HDMI cable that I just purchased on Amazon.
    And here's info about my MacBook Air:
    In the Amazon reviews, someone posted the following how-tos, which aren't working for me:
    1. Plug in both ends, mini display port on your macbook and the HDMI on any available port on your LCD.
    2. Go to upper left Apple menu and scroll down to system preference. Or use your FINDER from the dock, go to applications, then system preference.
    3. Click on Displays
    4. Click on DETECT DISPLAY
    5. A similar screen pops up with name of your LCD, mine says SONY LCD, click on ARRANGEMENT
    6. Click the box that says MIRROR DISPLAYS.
    7. Go back into system preferences and go to SOUNDS which is located under HARDWARE.
    8. Click on OUTPUT, then select HDMI, which should be listed next to your LCD name.
    I ran into trouble at step #4. My MacBook Air doesn't list the option of "detecting display." I do, however, have the box mentioned in step #6, "Show mirroring options in the menu bar when available."
    Regarding step #8, HDMI didn't appear in the list — I only see "internal speakers."
    So, what am I doing wrong? Or, did I buy the wrong cable?
    Thanks in advance for your help!

    Or you need to get an appropriate adaptor. The Griffin adaptor sold on Apple's Online Store will work with a standard HDMI cable.

  • I have 12 core with Quatro 4000 and 5770, I want to use dual monitor setup, monitors are NEC with Spectraview-II.  How do I connect?  4000 only has 1 Display Port and 1 DVI.  5770 has 2 of each, if I use both 5770 Display Ports, does the 4000 contribute?

    I just bought a 12 core with Quatro 4000 and 5770, I want to use dual monitor setup, monitors are NEC with Spectraview-II.  How do I connect?  4000 only has 1 Display Port and 1 DVI.  5770 has 2 of each, if I use both 5770 Display Ports, does the 4000 contribute any work at all?  I read where on a PC they would work together, but on a MAC they do not.
    I read that Display Port has higher band width than DVI, NEC monitors for best performance they recommend using DIsplay Port.
    When I was setting this up I looked at a Nvidia Quadro 4000, unfortunately it was for PC, it had 2 Display Ports, in the Mac version they reduce it to one.  I did not think there could be a difference.
    Mainly want to use it for CS6 and LR4.
    How to proceed??? 
    I do not want to use the Quadro 4000 for both, that would not optimize both monitors, one DP and 1 DVI.  Using just the 5770 would work but I do not think the 4000 would be doing anything, and the 5770 has been replaced by the 5870.more bandwidth.
    Any ideas, I am a Mac newbie, have not ever tried a Mac Pro, just bought off ebay and now I have these problems.
    As a last resort I could sell both and get a 5870.  That would work, I'm sure of that, it's just that I wanted the better graphics card.
    Thanks,
    Bill

    The Hatter,
    I am a novice at Mac so I read all I can.  From what I understand the NEC monitors I bought require Display Port for their maximum performance.  The GTX 680 only has DVI outputs.  Difference from what I understand is larger bandwidth with the DP.
    You said I have the 4000 for CUDA.  I am not all that familiar with CUDA and when I do read about it I do not understand it. 
    A concern I have is, that if I connect the 2 high end NEC monitors via the 5770, using it's 2 Display Ports I would have nothing connected to the 4000.  Is the 4000 doing anything with nothing connected?  I read where in a PC system the 2 cards would interact but in a Mac system they do not.
    Bottom line, as I see it, the 4000 will not be useful at all to me, since I want a dual monitor set-up.
    So far the 5870 seems the best choice, higher band width than the 5770, and it has 2 Display Ports to optimize the NEC monitors.
    I'm not sure how fine I am splitting hairs, nor do I know how important those hairs are.  I am just trying to set up a really fast reliable system that will mainly be used for CS6 and LR4.  Those NEC monitors are supposed to be top notch.

Maybe you are looking for

  • Creation indicator purchase requisition in md02

    Hello SAP Gurus,      This is regarding creation indicator purchase requisition in md02.In this creation indicator purchase requisition if we keep setting as 2 than it will create purchase requisition if the dates of PR are in the opening period and

  • How can I play ABSOLUTELY LOSSLESS video on the iPad2?

    Hi everyone!  I'm creating some test videos for a project I'm working on.  I have a sequence of png test images that are 1024x768.  I would like to have these images play back on the iPad2 as a video.  The catch is that there needs to be absolutely z

  • How do I change the settings to remember my login and password if I accidentally clicked not to remember password?

    I know that when Autofill is on and you login to a website for the first time a message will pop up that asks if you would like for Safari to remember your passwoard, but what if you accidentally click "no" or "not now" and would like it to remember

  • Booting thinkpad t61 without a keyboard

    I'm having the following problem with my Thinkpad T61. Every few minutes the computer starts behaving as if a few keys on the keyboard are pressed. The keys are no physically stuck, the system just behaves as if they are. This happens sometimes for n

  • Searching for a specific Server

    When using Finder to find files that are on a mounted server I can't specify the exact server to look in. It just gives me "shared", "This Mac" and my hard drive. It takes too long to let it search thru all of the shared files. Can I specifically sel