How to resize dynamically loaded Base64 Image?

Hi all,
I'm currently writing a flex component which renders a
formular from a
xml definition file. I get the image as Base64 and decode it
whith some
flex internal methods.
private function addBgImage(base64Image:String):void{
var base64Decoder:Base64Decoder = new Base64Decoder();
base64Decoder.decode(base64Image);
var byteArray:ByteArray = base64Decoder.flush();
var loader:Loader = new Loader();
loader.loadBytes( byteArray );
var img:Image = new Image();
img.addChild(loader);
this.addChild(img);
This works fine. Now i want to resize the image, but nothing
works. I
tried:
img.width = 100;
img.maxWidth = 100;
img.explicitWidth = 100;
loader.width = 100;
But nothing works. Can somebody help me? Do I need to wait
till the
ByteArray is loaded?
Best regards,
Christian

solved.
solution:
I have to wait till the loader finished loading and then i
can resize the image in this method.
private var loader:Loader;
private function addBgImage(base64Image:String):void{
var base64Decoder:Base64Decoder = new Base64Decoder();
base64Decoder.decode(base64Image);
var byteArray:ByteArray = base64Decoder.flush();
loader = new Loader();
loader.loadBytes( byteArray );
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
imgLoaded);
var img:Image = new Image();
img.addChild(loader);
this.addChild(img);
private function imgLoaded(event:Event):void{
loader.width = 100;
}

Similar Messages

  • How can I best load RAW images from a Canon SX50?

    How can I best load RAW images from a Canon SX50?

    9Sorry, ........confused about this process.   When I attempted to Post the question I had entered, I was told a blank space could not be posted.  So, I reentered the Q in the "space"........ which apparently was the space for an answer....!! ??......)
    >  When I try to load RAW images taken by my Canon SX50 from the SD card, iPhoto 11 -  (iMac/OSX 10.6.8) tells me that it can't read the format or something like that.    OSX 10.6.8 came out before the SX50, thus, did not include the related program.           I want to shoot RAW on the SX50....... but I then want to load them into iPhoto....... which I do directly from pics I take with my Nikon D200.  
    Not sure if this will help.............

  • How to dynamically load an Image into a TableView when its row/cell becomes visible?

    Hi,
    I am building an application that shows tables with large amounts of data containing columns that should display a thumbnail. However, this thumbnail is supposed to be loaded in the background lazily, when a row becomes visible because it is computationally too expensive to to this when the model data is loaded and typically not necessary to retrieve the thumbnail for all data that is in the table.
    I have done the exact same thing in the past in a Swing application by doing this:
    Whenever the model has changed or the vertical scrollbar has moved:
    - Render a placeholder image in the custom cell renderer for this JTable if no image is available in the model object representing the corresponding row
    - Compute the visible rows by using getVisibleRect and rowAtPoint methods in JTable
    - Start a background thread that retrieves the image for the given rows and sets the resulting BufferedImage in a custom Model Object that was used in the TableModel (if not already there because of an earlier run)
    - Fire a corresponding model change event in the EDT whenever an image has been retrieved in the background thread so the row is rendered again
    Btw. the field in the model class holding the BufferedImage was a weak reference in this case so the memory can be reclaimed as needed by the application.
    What is the best way to achieve this behaviour using a JFX TableView? I have so far failed to find anything in the API to retrieve the visible items/rows. Is there a completely different approach available/required that uses the Cell API? I fail to see it so far.
    Thanks in advance for any hints here.

    Here’s what I have tried so far:
    I have defined a property in my model object that contains a weak reference to the image that is expensive to load. I have modeled that reference as an inner class to the object so I have a reference to its enclosing object. That is necessary because my cell factory otherwise has no access to the enclosing model object, which it needs to trigger loading the image in the background.
    The remaining problems I have is, that I don’t have sufficient control over the loading process, i.e. I need to delay the loading process until scrolling has stopped and abort it as soon as the user starts scrolling again and the visible content changes. Imagine that loading an image for a table row (e.g. a thumbnail for a video) takes 200ms to load and a user quickly scrolls through a few hundred records and then stops. With my current set-up, the user has to wait for all loading processes that were triggered in the cell factories to finish until the thumbnails of the records they are looking at will appear (imagine an application like finder to be implemented like that, it would simply suck UX-wise). In my swing application a background thread that loads images for the visible records is triggered with a delay and stopped as soon as the visible content changes. This works well enough for a good user experience. I don’t see how I can do this based on the cell API. It is nice to have all this abstracted away but in this case I do not see how I can achieve the same user experience as in my swing application.
    I also tried registering a change listener to the TreeCell’s visible property to make that control the image loading but I don’t seem to get any change events at all when I do that.
    I must be missing something.

  • Dynamic load of images in to established Timeline effect

    Is it possible to dynamicly load images in to an already
    established timeline effect?
    Steps I've done.
    Stuffed a JPG in to the library by draging and dropping it in
    to the SWFs library.
    Dropped the JPG on to the main stage
    Right clicked the image then going down to Timeline effects
    and choosing an effect.
    Completing any changes in effects dialogue box and then
    clicking OK.
    Play the movie, and pat myself on the back that it worked.
    So then, how can I get Actionscript to load an image
    dynamically in to that same Timeline effect and have it do the
    effect to that instead of the one found in the library?
    I'm using Flash MX Professional 2004.

    hii
    Can u mention the error message getting while the status become RED??
    As what I understand, this may be the issue of invalid characteristics inPSA Data Records or also there may be records that does not support the lower case or upper case data.
    So just check the data in PSA Level
    Thanks
    Neha

  • How do I dynamically load a SWF that was compiled from an Fla with a linked external class file

    I am dynamically loading external SWFs in a Main Fla in response to clicks on a menu.
    The loading code is standard and works fine for all of the SWFs except one. When I try to load it I get the following error:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
    I am certain that the URL to the problem SWF is correct. The SWF itself doesn't load any other SWFs or images.
    The problem SWF is linked to an external class file and compiled with it.
    i.e. in the properties panel of the main timeline of the problem SWF's Fla I have entered the path to the external class.
    1. there is no problem compiling this SWF with the class (it works fine by itself)
    2. if I remove the external class from the properties panel and don't use it the resulting SWF imports without a problem into the Main Fla mentioned before
    So the problem seems to be the fact that the external class is linked in the properties panel. Is this a path problem?
    Would appreciate any suggestions,
    Thanks!

    despite what you say, that loaded swf most likely is loading something and that's the cause of the error.
    you could test that by putting the main swf's embedding html file in the same directory with problematic swf.  if the problem is as explained above, you'll have no problem when the main html is in the same directory with the loaded swf.

  • Dynamically loading binary image of report source file

    Post Author: ChristopherZ1
    CA Forum: .NET
    I have stored all my .rpt files as varbinary images in a SQL 2005 DB.  I can retrieve the image write it to disk then load the report. i.e.
    Private m_RptDoc As New ReportDocument()
    m_RptDoc.Load(RptPathName). 
    My question is...is there a way to load the image directly into the ReportDocument without first writting it to disk and using the pathname?

    I would think that this crummy custom Image class hack would work, but surprise surprise -- the width/height in loaderInfo is flat out WRONG when the event fires. It seems to have a hard coded width/height no matter what the file size. Silly!
    <mx:Image xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
         <mx:Script>
              <![CDATA[
                   public function init():void {
                        this.addEventListener(Event.COMPLETE, loaded);
                   private function loaded(e:Event):void {
                        this.width = this.loaderInfo.width;
                        this.height = this.loaderInfo.height;
              ]]>
         </mx:Script>
    </mx:Image>
    Turns out, this version DOES work (but it's still a hack fix in my opinion):
    <mx:Image xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
         <mx:Script>
              <![CDATA[
                   public function init():void {
                        this.addEventListener(Event.COMPLETE, loaded);
                   private function loaded(e:Event):void {
                        this.width = this.contentWidth;
                        this.height = this.contentHeight;
              ]]>
         </mx:Script>
    </mx:Image>
    You guys at Adobe are so silly.    It would seem to me that Image's width and height should be set (rather than left at 0) once the content's width and height is known.  So now that I've fixed this bug (as far as I'm concerned) for ya Adobe, I take cash, cashier's check, or money orders--thanks!
    But really, if this doesn't work this way in Flex 4, I think it should.

  • How to use dynamic loaded embeded font?

    I have loaded fonts.swf on startup. I don't use TextLayout
    Embeded fonts feature. Then i have loaded some xml and assign xml
    to TextLayout. How I can use loaded font for display?

    Are you using Flash CS4 or Flex?
    Check out the following blog post, it contains instructions
    for font embedding that may help you out:
    Embedded
    Font Subsetting Using DefineFont4

  • How to style dynamically loading text?

    Hi,
    I am dynamically loading a .txt file into CS3 using
    ActionScript 3.0. I want to style the text using CSS/HTML. The only
    thing I can get to function using CSS/HTML is the "a tag", I can't
    seem to get bold, colour, font, etc working. Should i be using CSS
    or should I be doing this styling from ActionScript in the swf
    files? I have checked the help files but I could get their tags to
    work.
    Any suggestions very welcome.
    Thanks.

    you will have more control over all of this if you feed in an
    xml file rather than a txt file. you can stipulate your class
    attributes within the xml then
    if you want to style the dynamic content using just your txt
    file and the controls within the fla you could embed the typeface
    glyphs you want to use within your output swf file and colour them
    / change weight etc within the fla
    hope that is of some use
    ;-)

  • How to unload dynamically loaded modules?

    Hi,
    I have a problem with unloading module, which I loads dynamically.
    Here is a fragment my code:
    <TitledWindow .......creationComplete="init()"/>
    <mx:Accordion id="lista_ryzyk">
    </mx:Accordion>
    <mx:Script>
    public function init():void
    {    CairngormEventDispatcher.getInstance().addEventListener(LoadRisksEvent.EVENT_RESULT, populateAccordion);
    public function populateAccordion(event:CairngormEvent):void
         lista_ryzyk.removeAllChildern();
         for (i in risks)
              var m:ModuleLoader = new ModuleLoader();
              m.url = path_to_module;
              m.label = module_label;
              m.loadModule();
         lista_ryzyk.addChildAt(m,Number(i));
    </mx:Script>
    The modules loads fine. Each module adds own eventListener for some event. It works fine, but ONLY for first time. For next invoke populateAccordion function, the modules loads, but don't reacts for event. I investigate !!! that for events reacts that modules, which was loaded for the first time!!! How to remove it????

    Using array, didn't solve my problem, but it is possible that I'm doing something wrong.
    I still can't catch event in second time loaded module :-((( I have tried to solve this problem from wednesday! it goes me crazy!
    Could you, or anybody, try to inspect my code and help me? I have no idea how to manage it.
    I know exactly what is wrong, but I can't improve that. In module's creationComplete function I display the UID of this module, and in body of eventHandler function I do the same. In case of FIRST time  the displayed UID are the same, but when I load the module second time, the UID of the loaded module displayed in creationComplete function is new, but the UID displayed in handler function is the same as the first loaded module. So my event is catch by the wrong modul, and I don'tknow how to change it, how to process event in my newly loaded module.

  • Is it possible to dynamically load an image/resources embed in a SWF?

    Hi all,
       i have created a flex library project, just containing images (.GIF)...etc.
       And i create another flex application project that merge the .GIF files into the final SWF application.
      based on the current time, i want to display different pictures (e.g. sun.GIF, moon.GIF, star.GIF...etc..there are many images) in the application right-top corner.
      as, i know, <mx:image/> just work with static image reference for embedded resource.
    (<mx:image source="@Embed('sun.GIF'))"/>).
      i search by google, it seems that, for embedded image or resource, you can't load it dynamically.
      the following code don't work.
      e.g. var mmm:Image = new Image();
                   mmm.source = fileName;
                   mmm.load();
      anybody find the solution???
      thank you.
    ppk luk

    Hi,
      i have tried this method before, but, again, it don't work for embedded resource. IO error will be thrown, with error message.
    IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2036: Load Never Completed. URL: file:///E:/Flex/TmpAssetApp/bin-debug/@Embed(source='images/sun.GIF')"]
    (the GIF is in a folder called images)
    SWFLoader/Loader can only load file dynamically from URL, but not embedded resource?? (by syntax @Embed(source='xxx'))??
    my sample code:
    =======================================
    <mx:Script>
            <![CDATA[
                import mx.controls.Alert;
                [Bindable]
                private var fileName:String = "@Embed(source='images/last.GIF')";
                 * Show the image
                private function showImage(event:flash.events.MouseEvent):void{
                    fileName = fileTxt.text;
                    dynaLoader.source = "@Embed(source='" + fileName + "')";
                    //dynaLoader.addEventListener(flash.events.Event.COMPLETE, ss);
                    //dynaLoader.addEventListener(flash.events.IOErrorEvent.IO_ERROR, ff); 
                    dynaLoader.load();
                private function ss(event:flash.events.Event):void{
                        mx.controls.Alert.show("result1\n" + event);
                private function ff(event:flash.events.IOErrorEvent):void{
                        mx.controls.Alert.show("result2\n" + event);
            ]]>
        </mx:Script>
        <mx:SWFLoader height="305" left="10" right="10" bottom="10" id="dynaLoader" autoLoad="true" source="{fileName}" ioError="ff(event)" complete="ss(event)"/>
    =======================================
       Do you know any other solution?
      thank you.
    ppk luk

  • How to resize canvas for this image?

    I've watched Julianne Kost's tutorial on resizing canvas size but I can't figure out what to do with this photo.
    Before you see it, here's what I'd like to achieve - white borders around this image (which is not 4x3) so that the entire image becomes 20x16.
    Seems my image is only 1900x1200 so do I need to resize the image first?
    Thanks for your help.

    solved.
    solution:
    I have to wait till the loader finished loading and then i
    can resize the image in this method.
    private var loader:Loader;
    private function addBgImage(base64Image:String):void{
    var base64Decoder:Base64Decoder = new Base64Decoder();
    base64Decoder.decode(base64Image);
    var byteArray:ByteArray = base64Decoder.flush();
    loader = new Loader();
    loader.loadBytes( byteArray );
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    imgLoaded);
    var img:Image = new Image();
    img.addChild(loader);
    this.addChild(img);
    private function imgLoaded(event:Event):void{
    loader.width = 100;
    }

  • HELP!! NEWBIE - Dynamically load jpg images - NEWBIE Question.

    Newbie here.
    Im currently making a flash website. and trying to make it as light as possible.
    so decided to load images dynamically.
    Im using UILoaders.
    I drag the UILoader from components into the main timeline and set the source as 1.jpg, because the image is in the same folder as the .fla file.
    and scale - false
    Tested the movie but nothing shows up. i guess i need some coding? but i dont know where to add the codes. on the same frame? or in frame 1?
    i also need the image to fade-in.
    the end result im looking for is, as i click a button. 3 images show up at the same time, fading in.
    Help, greatly appreciated.
    and thanks in advance

    thanks your the reply,
    the source is set to 1.jpg i put a image file named 1.jpg into the same as the fla. and swf and everything.
    the UILoader is visible in frame 55 or so. and as i click a button the pic is suppose to show , but it doesnt??
    the jpg is also non-progressive..
    any idea why its not working?

  • How can I dynamically center an image in Crystal Reports?

    Hi! I'm using Visual Studio 2010, SQL Server 2008 R2 and Crystal Reports 13_0_11.
    I have a database full of images type image in SQL Server. Every image has diferent width. 
    I create a report with Crystal Reports and a Dataset and does everything that I want. But I can't horinzotal align the image, in the property window, the horizontal align option is disable, I don't know why... and I don't know what to do... 
    Please help me with how can I center the images or how can I enable the option...

    Hi Fafa0239,
    Since it is related to the Crystal Reports, please post questions related to third-party products in their forums (http://scn.sap.com/thread/3440443).
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Dynamic Loading of image-Works in Designer bt fails when viewed in infoview

    Dear All,
    I am trying the display Dynamic Image by setting the property of OLE Object "Format Graphic -> Picture -> Graphic Location Property. I am retrieving the image using  an web application (which is developed in .Net platform). When I set the URL and preiview the report in Crystal Designer it works fine, but when I publish the report to info view it fails. The report displayes the original Image which was used while inserting the object in the report.
    The sample URL to retrieve image is mentioned below;
    http://<Server Name>/getmyimage.aspx??PID=&FID=ac1788f2-40a8-4b93-ae9b-48c2ef7b6287.JPG&W=335&H=145&ZI=0&ratio=1&TIMESTAMP=20101025T110523Z&random=0.9074388616085233
    I searched the forum topic and found several posts.
    One of the resolution I understed was to replace u2018?u2019 with u2018??u2019 so that the parsing of image will be done accurately. I also tried this but it could not resolve issue.
    I am using Crystal 2008 for report development and BOE server version is BO XI 3.1 with SP 1 and FP 1.6. The server is running on Solaris Server.
    Looking forward for any solution/suggestion/clues on this.
    Thank you,
    With Regards,
    Sachin Dalal
    Edited by: SachinDDalal on Nov 13, 2010 1:09 PM
    Edited by: SachinDDalal on Nov 13, 2010 3:01 PM

    Hello Sachin,
    Did you find any solution for this...please let me know, yaar
    Really appreciate it
    Regards,
    Kamal

  • How to display dynamically generated SVG image

    Hello, I need some help on this issue...
    I need my page to display programmatically generated SVG image. but if i directly pass SVG string to the page like <h:outputText value="#{MyBean.SVGresult}"/> it will pop up a download dialog box. what should i do to properly include my svg into the page by using embed tag??

    The h:graphicImage does not appear to handle svg; maybe it should be extended. I'm still looking for the best way to do it. I don't know if I have the right solution but here is what I have done so far. This will throw up a x, y polyline graph.
    Put a panelGrid as place holder in the jsp
          <h:panelGrid  title="Report" style="color=black" border="0" id="dataReports" columns="1" binding="#{dataAnalysis.dataReport}">
          </h:panelGrid>Then take a 'template' svg and fill it in with the dynamic additions and changes in the backing bean. In a submit action
                    generateSVGGraph(twothetaArray, intensityArray);
                    UIColumn c=new UIColumn();
                    HtmlOutputText op=new HtmlOutputText();
                    op.getAttributes().put("style","color=black");
                    op.setTitle("header text");
                    op.setValue("header text");
                    c.setHeader(op);
                    //c.getFacets().put()
                    //c.getChildren().add("<embed src=\"../phase.svg\" align=\"left\" width=\"500\" height=\"500\" type=\"image/svg+xml\"/>");
                    //javax.faces.webapp.UIComponentBodyTag embed=new javax.faces.webapp.UIComponentBodyTag();
                    //javax.servlet.jsp.tagext.TagAdapter;
                    com.hypernex.jsf.ext.html.HtmlEmbedGraphic embedGraphic=new com.hypernex.jsf.ext.html.HtmlEmbedGraphic();
                    //embedGraphic.
                    embedGraphic.getAttributes().put("src","../session/phase"+phaseGraphCount+".svg");
                    embedGraphic.getAttributes().put("align","left");
                    embedGraphic.getAttributes().put("width","600");
                    embedGraphic.getAttributes().put("height","500");
                    embedGraphic.getAttributes().put("type","image/svg+xml");
                    c.getChildren().add(embedGraphic);
                     dataReport.getChildren().add(c);
                   c=new UIColumn();
                    op=new HtmlOutputText();
                    op.getAttributes().put("style","color=black");
                    op.setTitle("header text");
                    op.setValue("header text");
                    c.setHeader(op);
                    HtmlOutputText out=new HtmlOutputText();
                    out.getAttributes().put("style","color=black");
                    //out.setTitle("Figure 1.  Powder intensity as dependent on 2&theta;.");
                    out.setValue("Figure "+phaseGraphCount+".  Powder intensity as dependent on 2Theta.");
                    c.getChildren().add(out);
                    dataReport.getChildren().add(c);
    ...generateSVGGraph
        protected void generateSVGGraph(double[] x, double[] y)
            //FacesContext context = FacesContext.getCurrentInstance();
            //context.
            //Create an svg graph of the equation.
            org.apache.batik.dom.svg.SAXSVGDocumentFactory svgFactory=new org.apache.batik.dom.svg.SAXSVGDocumentFactory("org.apache.xerces.parsers.SAXParser");
               org.apache.batik.dom.svg.SVGDOMImplementation svgDOMImplementation=new org.apache.batik.dom.svg.SVGDOMImplementation();
            org.w3c.dom.DocumentType dt=null;//svgDOMImplementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN",f.toURI().toString());
            //System.out.println(dt);
         org.w3c.dom.svg.SVGDocument svgOMDocument=null;
            try
                System.out.println("dir "+(new java.io.File(".")).toURI().toString());
                svgOMDocument=(org.w3c.dom.svg.SVGDocument)svgFactory.createDocument((new java.io.File("../webapps/jsf-wita/siteadmin/templates/graph-template.svg")).toURI().toString(), new java.io.FileInputStream(new java.io.File("../webapps/jsf-wita/siteadmin/templates/graph-template.svg")));//new org.apache.batik.dom.svg.SVGOMDocument(dt, (org.w3c.dom.DOMImplementation)svgDOMImplementation);
                org.w3c.dom.svg.SVGSVGElement root=svgOMDocument.getRootElement();
                        org.apache.batik.dom.svg.SVGOMGElement primary_g=new org.apache.batik.dom.svg.SVGOMGElement("", (org.apache.batik.dom.AbstractDocument)svgOMDocument);
                        primary_g.setAttribute("style","stroke:black; fill:none; stroke-width:1");
                        root.appendChild(primary_g);
                        //double[] x=new double[4*90];
                        //double[] y=new double[x.length];
                        //x[0]=(double)(1)/4.0;
                            //methodArgs[0]=new Double(Math.toRadians(x[0]));
                        //y[0]=((Double)method.invoke(mathmlObject, methodArgs)).doubleValue();
                        double xMin=x[0];
                        double yMin=y[0];
                        double xMax=x[x.length-1];
                        double yMax=xMax;
                        double xOfyMax=yMin;
                        StringBuffer points=new StringBuffer();
                        for(int index=0;index<x.length-1;index++)
                            //System.out.println(x[index]+" "+y[index]);
                            //x[index]=(double)(index+1)/4.0;
                            //methodArgs[0]=new Double(Math.toRadians(x[index]));
                            //y[index]=((Double)method.invoke(mathmlObject, methodArgs)).doubleValue();
                            double cx=x[index];
                            double cy=y[index];
                            //if(xMin>cx)xMin=cx;
                            if(yMin>cy)yMin=cy;
                            //if(xMax<cx)xMax=cx;
                            if(yMax<cy)
                             xOfyMax=cx;
                             yMax=cy;
                        org.w3c.dom.svg.SVGTextElement xLabel=(org.w3c.dom.svg.SVGTextElement)svgOMDocument.getElementById("xLabel");
                        xLabel.getFirstChild().setNodeValue("2?");//?");
                        org.w3c.dom.svg.SVGTextElement xMinimumLabel=(org.w3c.dom.svg.SVGTextElement)svgOMDocument.getElementById("xMinimumLabel");
                        xMinimumLabel.getFirstChild().setNodeValue(ddf.format(xMin,4).toString());
                        org.w3c.dom.svg.SVGTextElement xMaximumLabel=(org.w3c.dom.svg.SVGTextElement)svgOMDocument.getElementById("xMaximumLabel");
                        xMaximumLabel.getFirstChild().setNodeValue(ddf.format(xMax,4).toString());
                        org.w3c.dom.svg.SVGTextElement yMinimumLabel=(org.w3c.dom.svg.SVGTextElement)svgOMDocument.getElementById("yMinimumLabel");
                        yMinimumLabel.getFirstChild().setNodeValue(ddf.format(yMin,4).toString());
                        org.w3c.dom.svg.SVGTextElement yMaximumLabel=(org.w3c.dom.svg.SVGTextElement)svgOMDocument.getElementById("yMaximumLabel");
                        yMaximumLabel.getFirstChild().setNodeValue(ddf.format(yMax,4).toString());
                        for(int index=0;index<x.length-1;index++)
                            points.append((x[index]-xMin)*500/(xMax-xMin));
                            points.append(",");
                            points.append((y[index]-yMin)*500/(yMax-yMin));
                            points.append(" ");
                        //System.out.println(points);
                        org.apache.batik.dom.svg.SVGOMGElement g=new org.apache.batik.dom.svg.SVGOMGElement("", (org.apache.batik.dom.AbstractDocument)svgOMDocument);
                        g.setAttribute("id",(String)"data");
                        g.setAttribute("transform", "translate(100, 550)");
                        g.setAttribute("style","stroke:black; fill:none; stroke-width:1");
                        org.apache.batik.dom.svg.SVGOMPolylineElement polyLine=new org.apache.batik.dom.svg.SVGOMPolylineElement("", (org.apache.batik.dom.AbstractDocument)svgOMDocument);
                        polyLine.setAttribute("fill", "none");
                        polyLine.setAttribute("stroke", "blue");
                        polyLine.setAttribute("transform", "scale(1, -1)");
                        polyLine.setAttribute("stroke-width", "1");
                        polyLine.setAttribute("points", points.toString());
                        g.appendChild(polyLine);
                        primary_g.appendChild(g);
                       javax.xml.transform.TransformerFactory tFactory = javax.xml.transform.TransformerFactory.newInstance();
                       javax.xml.transform.Transformer intermediateTransformer=tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("../webapps/jsf-wita/stylesheets/identity.xsl"));
                                    intermediateTransformer.setOutputProperty(OutputKeys.ENCODING, "iso-8859-1");
                                    intermediateTransformer.setOutputProperty(OutputKeys.INDENT, "yes");
                         intermediateTransformer.transform(new javax.xml.transform.dom.DOMSource(svgOMDocument), new javax.xml.transform.stream.StreamResult(new java.io.FileOutputStream("../webapps/jsf-wita/session/phase"+phaseGraphCount+".svg")));
            catch(javax.xml.transform.TransformerConfigurationException tce)
                System.out.println("tce err: "+tce.getMessage());
            catch(javax.xml.transform.TransformerException te)
                System.out.println("te err: "+te.getMessage());
            catch(java.io.FileNotFoundException fnfe)
                System.out.println("fnfe:"+fnfe.getMessage());
            catch(java.io.IOException ioe)
                System.out.println("io:"+ioe.getMessage());
        HtmlEmbedGraphic.java
    * HtmlEmbedGraphic.java
    * Created on May 16, 2004, 8:12 AM
    package com.hypernex.jsf.ext.html;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.context.ResponseWriter;
    * @author  hyperdev
    public class HtmlEmbedGraphic extends javax.faces.component.UIComponentBase
        /** Creates a new instance of HtmlEmbedGraphic */
        public HtmlEmbedGraphic()
            super();
        public String getFamily()
            return "javax.faces.Data";
        public boolean isRendered()
            return true;
    public void encodeBegin(FacesContext context,
      UIComponent component) throws java.io.IOException {
      if ((context == null) || (component == null)){
          System.out.println("encodeBegin NullPointerException "+context);
        throw new NullPointerException();
          System.out.println("encodeBegin "+context+" "+component);
      //MapComponent map=(MapComponent) component;
      ResponseWriter writer = context.getResponseWriter();
      writer.startElement("embed", this);
      writer.writeAttribute("src", getAttributes().get("src"),"id");
    public void encodeEnd(FacesContext context) throws java.io.IOException {
      if ((context == null)){
        throw new NullPointerException();
      //MapComponent map = (MapComponent) component;
      ResponseWriter writer = context.getResponseWriter();
      writer.startElement("embed", this);
      writer.writeAttribute("src", getAttributes().get("src"),"id");
      writer.writeAttribute("align", getAttributes().get("align"),"id");
      writer.writeAttribute("width", getAttributes().get("width"),"id");
      writer.writeAttribute("height", getAttributes().get("height"),"id");
      writer.writeAttribute("type", getAttributes().get("type"),"id");
      writer.endElement("embed");
    }graph-template.svg - More static parts of the graphic can be put in here.
    <?xml version="1.0" encoding="UTF-8"?>
    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="text/ecmascript" width="100%" zoomAndPan="magnify" contentStyleType="text/css" viewBox="0 0 600% 600%" height="100%" preserveAspectRatio="xMidYMid meet" version="1.0">
    <g style="stroke:black; fill:none; stroke-width:1">
    <g id="visuals" style="stroke:black; fill:none; stroke-width:1" transform="translate(100, 550)">
    <rect id="box" transform="scale(1, -1)" x="1" y="1" width="500" height="500" fill="none" stroke="black" stroke-width="1.5"/>
    <g id="labels" transform="scale(1, 1)">
    <text id="xLabel" x="250" y="50" text-anchor="middle"
            font-family="Verdana" font-size="24" fill="blue" >x label</text>
    <text id="xMinimumLabel" x="0" y="20" text-anchor="middle"
            font-family="Verdana" font-size="18" fill="blue" >0.0</text>
    <text id="xMaximumLabel" x="500" y="20" text-anchor="middle"
            font-family="Verdana" font-size="18" fill="blue" >100.0</text>
    <text id="yMinimumLabel" x="-3" y="-3" text-anchor="end"
            font-family="Verdana" font-size="18" fill="blue" >0.0</text>
    <text id="yMaximumLabel" x="-3" y="-500" text-anchor="end"
            font-family="Verdana" font-size="18" fill="blue" >100.0</text>
    </g>
    </g>
    <g id="data" style="stroke:black; fill:none; stroke-width:1" transform="translate(10, 550)">
    </g>
    </g>
    </svg>

Maybe you are looking for

  • Functional specification and logic flow for smart form PO

    Dear Friends , For PO develelpment in smart form as per client requirement which are the details we need to give for developers . I had given only table and fiels name for the displaying elements in PO , message type , document type . They are asking

  • [Solved] SDDM does not unlock gnome-keyring

    Hi everyone! I did some searching but didn't find the answer to my issue yet. I'm using SDDM to log in to i3. The issue is that my keyring doesn't get unlocked after login and it asks for the password on first access (owncloud client). Now I want to

  • Where are the diagnostic LEDs in the imac g5 isight?

    I have looked everywhere, including under the right speaker. Have removed the display ... they are nowhere to be found. But I know they're hidden here somewhere!

  • Tolerance limit for Quantitative MICs

    Hi Experts, The scenario is for quantitative result recording, the decimal places for upper and lower values has been given as 3. So the user enters values with three decimal places. But in the case of fringe values like 9.999, the user requirement i

  • XMLP on Tomcat 5.5 Login Error

    Hello everybody, I performed a manual installation of XMLP 5.6.2 on tomcat 5.5.17 today. I followed the oracle guide: http://www.oracle.com/technology/software/products/publishing/install.html When I to login (login page gets displayed o.k.) with adm