Use FXG in Spark Image

I have a Spark Image component that is displaying thumbnails. There are a few thumbnails that were exported to FXG. I'd like to use those FXG thumbnails sometimes. Is there a way to use those FXG thumbnails in the Spark Image component?

The spark Image should act the same as BitmapImage.  Check out this article for an example of how to do it: http://blog.flexexamples.com/2010/10/10/displaying-an-fxg-file-in-a-spark-bitmapimage-cont rol-in-flex-4/

Similar Messages

  • How to create spark skins using fxg vector graphics&how to switch b/w spark skins at runtime/via XML

    Hi,
    I want to create a number of Spark Skins using some vector images that I have with me. I can obtain the vector images in FXG format-- but what I am looking for is some way to quickly create multiple skins for various UI elements like buttons, menus, radio button, checkboxes, etc -- not by converting the fxg->mxml but by using fxg files directly (after including them in the skins project in Flash Builder 4.6). Since I want to create many such skins (atleast 8-10) what is the fastest way of accomplishing this?
    Also, once I create multiple Spark Skins, how do I switch from one skin to another, in a running app? -- something like a template switcher, where the user viewing the flex app chooses a color, and the spark skin is immediately changed to the skin of that color (I would have already created the skin...). And can I store this skin template value in an XML? So that the end user can simply change this param in XML to change the design of the flex app?
    Arvind.

    Follow-up:
    Out of pure wishful thinking I decided I would just see what happened if I pretended 'exportFXG' was already a part of JSFL. Based on the signature of 'exportPNG', i tried the following lines:
      var success = fl.getDocumentDOM().exportFXG("file:///C:/mySymbol.fxg"); 
      fl.trace("success:"+success); // output: success:true 
    It worked! Fantastic! I'm not sure if exportFXG is considered still in "beta" and therefore intentionally excluded from the docs, or if it was just an oversight. But at least it gives us something to experiment with.

  • Using swf for source of spark image

    Hi, I'm not sure if something changed in flex 4.5.1 but I have a published version of my app from earlier (flex 4.0) that uses a spark image control and I'm able to assign a swf as the source and it displays no problem. I just tried in my newest version and I recieve an error "Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@e523f91 to flash.display.Bitmap". I'm not trying to access any properties -- just setting '.source = abc.swf'.
    Anyone have any idea why I can't assign a swf to an image control anymore?

    Yeah, it was harder than I thought it would be.  I got it to display with this subclass of BitmapImage, but I didn’t beat it up so there might be other issues:
    package
    import flash.display.Sprite;
    import flash.display.LoaderInfo;
    import spark.core.IGraphicElement;
    import spark.core.DisplayObjectSharingMode;
    import spark.primitives.BitmapImage;
    import mx.events.FlexEvent;
    public class MyBitmapImage extends BitmapImage
        private var imageWidth:Number;
        private var imageHeight:Number;
        override protected function measure():void
            super.measure();
            measuredWidth = imageWidth;
            measuredHeight = imageHeight;
        override public function canShareWithPrevious(element:IGraphicElement):Boolean
            return false;
        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
            super.updateDisplayList(unscaledWidth, unscaledHeight);
        override protected function contentComplete(content:Object):void
            var loaderInfo:LoaderInfo = content as LoaderInfo;
            // For untrusted content we must host the acquired Loader
           // instance directly as our DisplayObject.
           displayObjectSharingMode = DisplayObjectSharingMode.OWNS_UNSHARED_OBJECT;
            invalidateDisplayObjectSharing();
            // Create a content holder to use as our display object.
           var contentHolder:Sprite = new Sprite();
            setDisplayObject(contentHolder);
            contentHolder.addChild(loaderInfo.loader);
            // Retain our source image width and height.
           imageWidth = loaderInfo.width;
            imageHeight = loaderInfo.height ;
            // Update
           if (!explicitHeight || !explicitWidth)
                invalidateSize();
            invalidateDisplayList();
            // Dispatch ready event
           dispatchEvent(new FlexEvent(FlexEvent.READY));

  • Spark Image can't scale embedded SWF symbols?

    Can anyone help me make sense of this?
    Using Flex 4.5.1 (Spark only compile) I've found that the new Spark Image control works inconsistently when loading SWF at runtime and embedding SWF symbols. See these two situations:
    1) OK - Spark image loads a whole SWF in runtime. Swf loads OK and scales up to desired size with perfect smooth anti-aliased edges
    2) Not OK - Spark Image loads an embedded swf symbol as follows:
    <s:Image source="@Embed(source='embedded/GeneralSymbols.swf' , symbol = 'komodoDragon')"  x="250" y="35" height="200" />
    ( or using a bindable class )
    And the image is pixelated and totally unusable.
    It seems unfortunately that when embedding Swf Symbols ( which is a big element of the Adobe Flex - Flash - Illustrator workflow ) the "vector" images are reduced to bitmaps at their original size and don't scale.
    I know spark swfLoader is a possible option - but surely it's too heavy for loading many images?

    Hi Ged_mc.
    Did you find the answer to this?
    I'm using Flex 4.6 SDK and having the same problem. It's kind of dumb, isn't it?
    Especially since I'm migrating an application from Flex 3 to 4.6 and it worked perfectly in the previous version.
    Thanks!

  • Spark Image "bug"?

    Hello. I've encountered a problem with spark:Image class. I need to get it as a BitmapData.
    There's a BitmapData.draw(...) method for this. It works well with other components and allows to create a Bitmap representation of them.
    Actually, I'm using M2D engine and there such technique is used to accelerate DisplayObjects.
    I need to capture my image when it has finished loading content.
    So, I add an eventListener for COMPLETE event. But, what I get captured is just a white rectangle!
    I think, the problem is that the image doesn't finish its rendering yet, so it has content just loaded into memory by the time Event.COMPLETE is fired.
    So, I've tried to use FlexEvent.UPDATE_COMPLETE instead. It seems, it's fired three times when image.source changes.
    I get three BitmapData objects and the last one appears to be correct.
    Of cource, it can be thought of as a solution, but I don't like it It seems to be buggy.
    Maybe there is a "right" way to capture an image?
    mx:Image works right, by the way. But I want spark

    Is this similar to what you are working with? I pass in an invisible BorderContainer already added to the displayList. The bitmapData in my image_completeHandler seems to work as expected. Also, my _image only fires 2 "updateComplete" events (which is irrelevant because you shouldnt have to listen for it anyway).
    package
    import flash.display.BitmapData;
    import flash.events.Event;
    import mx.core.UIComponent;
    import mx.events.FlexEvent;
    import spark.components.BorderContainer;
    import spark.components.Image;
    public class Foo extends UIComponent
         //  Constructor
         public function Foo( container:BorderContainer )
              super();
              _image = new Image();
              _image.addEventListener(Event.COMPLETE, image_completeHandler);
              _image.addEventListener(FlexEvent.UPDATE_COMPLETE, image_updateCompleteHandler);
              container.addElement(_image);
              _image.source = "assets/hills.jpg";
         //  Variables
         private var _image:Image;
         //  Methods private
         private function image_completeHandler( event:Event ):void
              var bmpData:BitmapData = _image.bitmapData;
              trace(bmpData.width, bmpData.height);
         private function image_updateCompleteHandler( event:FlexEvent ):void
              trace(event.type);

  • How can I use a refrence background image ?

    HI,
    I need to register align horizontally and vertically) about 100 images to the first. I don't want to stack or merge them. An ideal way to accomplish this would be to be able to set the first image as a background reference image for all images in the group. There would be left/right buttons so I could advance through the stack, a slider to adjust the visibility of the foreground image, and up/down & right/left arrows so I could move the upper image a pixel at a time in any direction. In this case I don't need to rotate the image, but this would also be something a person might want to control. Then I would move through the group of images, stopping on each one to align the image to the first. One at a time, or after I am done, it would save all the aligned images to a new filename and folder, without changing the transparency of the image or in any way using the background reference image. Without rotating the images, every pixel in the new image would be the same as in the original, except moved. I would start by resizing the canvas of all the images so they have a border area. This way I can move the image around and not lose any of it.
    Of course I could put the reference image in the background layer and the image to be adjusted above it on another layer. Then i can use the background as a reference by making the upper image somewhat transparent. Finially I could delete the background layer and save the image with just the adjusted layer. But this would be tedius with 100 images, even worse if there were 1000..
    Is there a reference background image capability in Photoshop CC ? Is there a better or different way to do this ? Or can Bridge do it ?

    Perhaps I need to explain my specific application. I have 120 images that are part of a time lapse sequence. The camera is photographing a meteor shower. I was able to capture a meteor which left a persistent trail that lasted about 5 minutes. Because the camera is on a tripod, the stars are constantly moving and in fact moved quite a bit during the 5 minutes the trail was visible. These images are of much higher resulution than the 1080 video I am producing. I have used premier to track the spot in the images and show the meteor and trail as a video close up that runs at about 15% speed. because the exposures were 30 seconds ;long, every 33 seconds, the sky has visibly moved from image to image. because I use only a few keyframes Premier tracks the spot smoothly. But since the pictures are each moved, not moving, the stars in the final video move back and forth with each image. they never go anywhere, but this movement is distracting and annoying. Theoretically I could eliminate this movement by having a different key for each frame. But the better way is to prepare the images so they are all aligned. Then there will be no movement at all.
    You have seen this effect in documentaries. Here's a hypothetical situation. Someone has handheld video of an important event happening. because of the situation and the handheld camera, the picture moves around like crazy. To be able to view the event clearly as part of an investigation, each frame is aligned to the first so the subject doesn't move at all, while the image frame moves all around. I have seen this many times. Now I need to do it.
    I have 120 pictures which all must be aligned so the stars in the picture do not move. i need to see a refrence image through the image to be adjusted, so I can move the image to be adjusted until its stars are perfectly aligned with stars in the refrence image. Of course this is like stacking, which is used to reduce noise and increase detail. but I don't want to stack the images, just adjust them horizontally and vertically, and then save them in their adjusted state.

  • How can I use some of the image i am working on to paint with? like if I wanted to give someone an extra eye in the forehead, ow could i then paint their own i in the forehead? I know there is a paint tool for that, i just can't find it ... :/

    How can I use some of the image i am working on to paint with? like if I wanted to give someone an extra eye in the forehead, ow could i then paint their own i in the forehead? I know there is a paint tool for that, i just can't find it ... :/

    It sounds like you are talking about the cloning tool?
    Tool looks like this:
    Then when selected you can change the size of the brush and using Alt (windows) and Command (Mac) to select your region you want to copy then start to create you cloned image.
    Hope this helps?

  • Spry Menu problem with using a transparent background image

    Hi-  I'm new to CS5 and Dreamweaver. I just finished the beginning webpage tutorial and I have started to work on a personal project. The Problem: when I use a transparent png image as a backgroun-image for my spry menu it shows up fine in live view, but doesn't work in browser view (safari), in fact the menu reverts to it's original grey and blue boredom. Does anyone have a solution for me? Does this mean it will be grey and blue when it goes live? Thanks, Ruth333333

    Please supply a link to your site.
    Gramps

  • How to use radioButton(s) and image controls on windows phone 8.1

    how to use radioButton(s) and image controls on windows phone 8.1

    Hi aspirantme,
    >>how to use radioButton(s) and image controls on windows phone 8.1
    Which version of your app is? Runtime or Silverlight?
    For Runtime version, please see the following articles:
    #RadioButton class
    https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.radiobutton(v=win.10).aspx
    #How to add radio buttons (XAML)
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868200.aspx
    #Image class
    https://msdn.microsoft.com/library/windows/apps/br242752.aspx
    For Silverlight version, please refer to the following documents and guidelines:
    #RadioButton Class
    https://msdn.microsoft.com/en-us/library/windows/apps/system.windows.controls.radiobutton(v=vs.105).aspx
    #RadioButton control design guidelines for Windows Phone
    https://msdn.microsoft.com/en-us/library/windows/apps/hh202881(v=vs.105).aspx
    #Image Class
    https://msdn.microsoft.com/en-us/library/windows/apps/system.windows.controls.image(v=vs.105).aspx
    #Quickstart: Images for Windows Phone
    https://msdn.microsoft.com/en-us/library/windows/apps/jj206957(v=vs.105).aspx
    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.

  • Can I use Bridge to export image data into a .txt file?

    I have a folder of images and I would like to export the File Name, Resolution, Dimensions and Color Mode for each file into one text file. Can I use Bridge to export image data into a .txt file?

    Hello
    You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
    set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
    use strict;
    use open IN => ':crlf';
    chdir $ARGV[0] or die qq($!);
    local $/ = qq(\\0);
    my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
    local $/ = qq(\\n);
    #     CSV spec
    #     - record separator is CRLF
    #     - field separator is comma
    #     - every field is quoted
    #     - text encoding is UTF-8
    local $\\ = qq(\\015\\012);    # CRLF
    local $, = qq(,);            # COMMA
    # print column header row
    my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
    print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    # print data row per each file
    while (@ff) {
        my $f = shift @ff;    # file path
        if ( ! open(IN, '<', $f) ) {
            warn qq(Failed to open $f: $!);
            next;
        $f =~ s%^.*/%%og;    # file name
        @dd = ('', $f, '', '', '', '');
        while (<IN>) {
            chomp;
            $dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
            ($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
            ($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
            ($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
            ($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
            last unless grep { /^$/ } @dd;
        close IN;
        print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    EOF
    Hope this may help,
    H

  • Using Nikon D5200 NEF images in PSE

    Hi
    I currently have PSE8 which will not read the NEF images from my Nikon D5200. I know that I can use the Adobe DNG Convertor 7.3 to convert them to DNG outside of PSE8 then work with the DNG images in PSE8. However, I would prefer, if possible, to work directly with the NEF images as a plugin.
    This article:
    http://helpx.adobe.com/x-productkb/global/camera-raw-compatible-applications.html
    states that the current PSE11 can only support the Raw Camera Plugin up to 7.2. This article:
    http://helpx.adobe.com/creative-suite/kb/camera-raw-plug-supported-cameras.html
    indicates that the Nikon D5200 requires the Raw Camera Plugin 7.3.
    Q1 - Based on the above am I therefore correct that it is not currently possible to use Nikon D5200 NEF images directly in any currently available PSE?
    Q2 - If, the answer to Q1 is Yes does anyone have a feel for whether its likely in the next version of PSE? Or would I have to save up for the full Photoshop program to do what I want?
    Thanks
    Jetta
    Microsoft MVP

    The first link is out of date.
    Yes, photoshop elements 11 supports camera raw 7.3
    You should be able to update pse 11 to camera raw 7.3 by going to Help>Updates from within the pse 11 editor if you should decide to trial and/or purchase pse11.

  • Use mx and spark components in pure ActionScript project?

    I'm working on an AIR project in Flash Builder 4, but I'm not using MXML at all (pure ActionScript). Is there a way for me to instantiate and use mx and spark components without MXML? If not, what is the minimal amount of MXML I have to use? FYI, I've already tried all of the following hacks with absolutely no luck:
    http://www.actionscript.org/forums/showthread.php3?t=143062
    http://ersatz.tv/2009/off-topic-flex-components-without-mxml
    http://stackoverflow.com/questions/141288/possible-to-use-flex-framework-components-withou t-using-mxml
    I much prefer ActionScript over MXML. Why does Adobe have such a hard-on for this MXML ****?! It's like all that code and all those great components are going to waste.

    Me too.. . I'm a pure as3 guy and all these components go to waste. You would think they would allow people to generate components via mxml or as3...

  • Feel free to use these Snow Leopard images for your desktop - a Snow Leoard

    Feel free to use any of the images of a Snow Leopard on my .Mac page below.
    I took them at Marwell Zoo in the UK on Saturday 19th Sept.
    http://gallery.me.com/idparkinson#100351
    All the best,
    Ian

    Thank you very much! Lovely pics.

  • How to use MatrixLayout control for Images in UI5

    I am trying to use MatrixLayout for my images but not able to do that....
    I have Grid Layout in that i have added  four images and that should be display like
    image_1           image_2
    image_3          image_4
    I used Horizontal Layout but think it is not best approach.
    Please help me if anyone know this....
    Message was edited by: Michael Appleby

    Hi Prashant,
    You can use matrix layout with number of columns pre-defined and create rows according to your images.
    var oLayout = new sap.ui.commons.layout.MatrixLayout({
    layoutFixed : true,
    columns: 2,
    Create row from you content like:
    oLayout.createRow(image1,image2);
    oLayout.createRow(image3,image4);

  • Photoshop CS6 shut down after using for 5mins; no image can be display on canvas.

    Photoshop CS6 shut down after using for 5mins; no image can display on canvas.

    Thanks for your help.  Actually the problem was solved when turning off the GPU.   In the mean time, I would like to upgrade my Video Card, too.  My existing vedio card detials are as below.  May I seek your advice on any good method other than replace it.

Maybe you are looking for