Setting Canvas backgroundImage to a ByteArray

Is it possible to set a canvas backgroundImage to a ByteArray?  It looks like it has to be a url, but if it's loaded from FileReference, I don't have a url.
Any ideas??

Well i was also in the same situation what i did was that..i created an empty image file say empty.png 0 kb in my src folder of project then  write the avaiable bytearray to this file using filestream and set the background using the setstyle method..hope it helps..my app was an AIR app

Similar Messages

  • "Set canvas" to the marqueed area instead of "crop"?

    Is there a way to "set canvas" to the marqueed area without doing any math or losing the unseen areas like you would with "crop"? I can't find anything like that in the pulldown menus. If not, I'd like to put that on the Photoshop wish list.

    You can't.  But (there's always a but) if you have enough room (i.e. playing time) available in the project you can create a slideshow in iDVD
    and add all of the videos to it.
    If you do that set the Slide Duration time to anything except Manual or Set to Music.  Also do not select an transition.
    When you click on the Create Project button in Magic Movie you'll be able to use the "+" button to add the slideshow to the top menu. 
    OT

  • Canvas BackgroundImage

    var v:canvas;
    v.setStyle("backgroundImage","url");
    Instead of passing url , can we pass the image that was captured.( I mean we have an image and the changes to the image is been made by us, either width,height,x,y etc.)  so we need to capture this image and pass it to the above statement in place of url.
    Is this possible or not?
    Can any one help me with this?
    Thanks and Regards,
    Rajesh.

    Well i was also in the same situation what i did was that..i created an empty image file say empty.png 0 kb in my src folder of project then  write the avaiable bytearray to this file using filestream and set the background using the setstyle method..hope it helps..my app was an AIR app

  • Setting Canvas Background Color issue

    For some reason I cannot set a color for my canvas background. I have tried using setStyle('backgroundColor', colorNumber); in actionscript and setting directly in the mxml with no success. It only takes the value that is set in the design mode of Flex.  Ideally I want to load in a color value from an xml file and use that color value, which I have been doing for other components, but for some reason the canvas will not work. Any ideas???

    Ok this is complete code, where i'm reading xml through wrapper which you can do it through HTTPservice. Make sure you put proper swf name while embeding.
    <!--------------------------------------------------------------mxml code---------------------------------------------------------------------->
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="create()" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]">
    <mx:Script>
    <![CDATA[
    import mx.utils.ColorUtil;
    import com.anychart.visual.fill.Fill;
    import com.anychart.styles.Style;
    import mx.collections.XMLListCollection;
    import mx.rpc.events.ResultEvent;
    import mx.controls.Alert;
    [Bindable]
          public var inputdata:XMLListCollection;
          [Bindable]
         public var canvasData:String;
         [Bindable]
         public var list:XMLList;
         [Bindable]
         public var mycolors:Array = new Array();
         public var count:int=0;
         public var clrname:String;
        public function create():void{
        //Reading data from wrapper
        canvasData=mx.core.Application.application.parameters.canvasData;
        //convert into xml      
            list = new XMLList(canvasData);
            //datasource
            inputdata = new XMLListCollection(list);
            for(var j:int=0;j<3;j++){
        for each(var item:XML in inputdata){
    mycolors[j] =item..name[j].toString();
        public function showme():void{
        var value:String=" ";
        for(var i:int=0;i<3;i++){
        value = mycolors[i]+"\n"+value;
        Alert.show(value);    
        public function change():void{
        if(count == 3){
        count=0;
        clrname=mycolors[count];
        else{
        clrname=mycolors[count];
        Alert.show(count+" "+clrname); //This alert line is optional you can remove it all other lines are imp.
        count++;
        mycanvas.setStyle("backgroundColor",clrname);
    ]]>
    </mx:Script>
    <mx:Panel x="246.5" y="48" width="500" height="544" layout="absolute" backgroundColor="#E8E5E5">
    <mx:Canvas id="mycanvas" x="55" y="40" width="370" height="436" backgroundColor="0xFFFFFF" cornerRadius="20">
    <mx:Label x="51" y="55" text="This is Canvas" width="147" height="23" fontSize="17"/>
    <mx:Button id="btn1" x="51" y="99" label="Show me" click="showme()"/>
    <mx:Button id="btn2" x="152" y="99" label="Change"  click="change()"/>
    </mx:Canvas>
    </mx:Panel>
    </mx:Application>
    <-------------------------------------------------------------------------------jsp code where swf embeded--------------------------------------------------------------------------->
    <html lang="en">
    <head>
    <title></title>
    <%
        String canvasData = "<values><name>0xE4F9A0</name><name>0xA5BC4E</name><name>0x6693B0</name></values>";
    %>
    </head>
    <body scroll="no">
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    id="problem" width="100%" height="100%"
    codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
    <param name="movie" value="problem.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#869ca7" />
    <param name="allowScriptAccess" value="sameDomain" />
    <param name='FlashVars' value='canvasData= <%= canvasData %>'/>
    <embed src="problem.swf" quality="high" bgcolor="#869ca7"
    width="100%" height="100%" name="problem" align="middle"
    play="true"
    loop="false"
    quality="high"
    allowScriptAccess="sameDomain"
    type="application/x-shockwave-flash"
    pluginspage="http://www.adobe.com/go/getflashplayer"
    FlashVars="canvasData= <%= canvasData %>">
    </embed>
    </object>
    </body>
    </html>

  • Setting canvas display to 16:9

    Hi
    I've imported 16:9 footage from several sources, no sweat. I'm having difficulty consistently getting the canvas to display 16:9 without black bars above and below the viewing area. After many false starts I thought I had discovered a menu option that just selected 16:9. Now I can't find it. Anyone know how to select canvas display set at 16:9 without the black bars?
    Phil

    The canvas will display your media based on your sequence settings.
    If you are placing 16:9 anamorphic media in a 4:3 timeline, the bars are automatically added.
    To change sequence settings:
    Menu Bar> Sequence> Settings>General>Anamorphic 16:9
    or
    Control + 0 (zero) >General> Anamorphic 16:9
    Once you change the setting, you may have to load each clip into the VIEWER and change each clips' MOTION TAB>DISTORT setting to ZERO to get it to display correctly.
    Otherwise, create a new sequence using the easy preset for the appropriate setting and drop your material into that.
    Welcome to the forum. You may want to spend some time reading the manual about matching sequence settings.
    good luck.
    x

  • Setting canvas width and height objectdraw

    I would like to kno how to set the window height and width so users cannot resize it. I would like the methods to be out of the library objectdraw
    Thanks

    motherboarddude wrote:
    [http://eventfuljava.cs.williams.edu/library/objectdrawJavadocV1.1.2/index.html] no clue
    What does 'no clue' mean? That you have no clue if it is J2SE? The answer is no, it is not J2SE (or even a Sun standard extension like JavaHelp or JOGL). We know nothing about that API and can provide no help with it.
    (And in future, try to make your replies specific enough that people do not have to 'guess' what you mean. That becomes irritating, very quickly.)
    OTOH a brief perusal of the JavaDocs suggests the API has no component that extends Frame or JFrame, so the answer to your request that it use one of the methods of your custom library is "No, it provides no functionality to restrict the size of the frame the user is offered - since that frame will come from the J2SE".
    Of course, if you simply wanted to ensure the drawing canvas is never resized, simply add it as a 'no args' element in a GridBagLayout with no other GUI components in it. If the GBL is used as described, the component will be centered within it. Add a JScrollPane to the component in case the user shrinks the frame smaller than the preferred size of the drawing area. In Java 1.6+, call setMinimumSize() after packing, and you can afford to lose the scroll pane.

  • Setting Canvas Property

    Hi,
    Why i can't set these canvas property at run time Tab Attachement Edge,Active Style,Width Style at run time
    Thanks,

    The primary reason is because Oracle does not provide a method to do this with a standard Oracle Forms built-in. You can a third-party java bean (such as Francois Degrelle's Oracle Forms Look and Feel project) to accomplish many UI enhancements that are not natively available in Oracle Forms.
    Take a look at the link above for more information.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Setting canvas property of item during runtime

    Can anybody tell me how to set the canvas property of item in the block at runtime if the canvas property is set to null during runtime.
    Pls forward the answer.
    Thanks.

    Frank,
    Alternatively , you can create mirror item and place them on different canvases, further you can hide/show them.
    Thanks.
    Adinath Kamode

  • Setting canvas size at 300 ppi?

    Hi, I am trying to open a new document to make a design that will be printed.
    Since it will be printed, I set my resolution to 300 ppi.
    I need my canvas size to be 6.5" by 3.625", but the canvas size automatically sets itself to 6.5" by 3.627", and I can't change it.
    I don't have this problem at lower resolutions.
    Please help!
    Ps. I am working in CS6 if it matters.

    300 ppi x 3.625 in = 1087.5 pixels. But pixels are whole units, no such thing as half a pixel. So it rounds off to 1088 pixels
    which divided by 300 = 3.627 inches.
    If you want those exact numbers, that is 6.5 by 3.625 in, use a resolution of 600 ppi.
    Gene

  • How to set Canvas to show actual playback area size

    I have sequences that have source video footage in different aspect ratios (from VHS, Mini-DV etc.), however in FCE Easy Setup I have the output set to NTSC 720x480. Some of the sequences have video footage solely from the Mini-DV that is in a wide screen format (I believe 16:9), however that exact ratio is not important to this question.
    Question: I need to re-scale and pan the Mini-DV video so as to better relate to the output 720x480 format. Currently in either the Canvas or Viewer only the fully wide screen Mini-DV view is displayed. Is there a way to also display the 720x480 output window so as to be able to position the wider and shorter Mini-DV video?

    Thanks Skalicki that works. I am confused on one item though. I had initially created a sequence with the Mini-DV video inserted where the Canvas and Viewer only showed the widened view (not overlaid with the 720x480 output limits showing). I followed your advise then copy/pasted the same footage into the newly created sequence and I now get the correct width video with bars at top and bottom that I can easily correct using the Motion settings. Do you know why the initial sequence would not include the 720x480 output? Thanks for any thoughts.

  • How to set canvas extension color for arbitrary image rotation?

    I'm using Photoshop CS4 v 11.0 with Windows XP.  When adjusting canvas size there's a menu for chosing the canvas extension color.  Where is the menu for chosing canvas extension color for arbitrary image rotation?
    Thanks.

    This will be the background colour selected in your toolbox.

  • Set Canvas/Artboard to exact page size?

    Hi guys,
    I am making a website on Illustrator 1,200 px 1,200 px. When i export it to .PSD i open it as a much larger file in pixels than this and with a whole Canvas/Artbord white area which i don't need.
    Is there any way to keep the page size like the final ouput without the white canvas area in the export?
    Thanks!
    Sebs.-

    Save for web >> image size tab >> check clip to artboard.

  • Changing the background image of a canvas at runtime

    =========
    [Bindable]protected var bgImage:Image; private
    private   function GetConfigurationResult( event:WsVCIGetConfigurationDataResultEvent):void
    var simage:String = event.result.Image; 
    var decoded:ByteArray; 
    decoder.decode( simage );
    decoded = decoder.toByteArray( );
    bgImage.data = decoded;
    setStyle(
    "backgroundImage", "assets/images/marshes2.jpg" ); 
    =========
    The code above is the result event from a call to a web service to get the contents of an image file from and SQL database.
    Works ok up to bgImage.data = decoded;
    But using "setStyle" has no parameter for passing the bytearray data block of the image.
    The above code, calling [ ("backgroundImage", "assets/images/marshes2.jpg" ] does something, but not what I want.
    The web service is called from the canvas [ initialize="init();"] function.
    When I set canvas feature [ backgroundImage="{bgImage}" ] it resolves, but I get some error trap from some low level image handling module.
    How do I resolve a background  image during load at runtime?

    Since setStyle takes a string and an object for inputs, one would expect that the following would work
    ===========
    private function GetConfigurationResult( event:WsVCIGetConfigurationDataResultEvent):void
    {// retrieve the 64base encoded image from the web service by ResultEvent
    var  
    bgImage:Image =new Image();
    var simage:String = event.result.Image; 
    var decoded:ByteArray;
    var  
    decoder:Base64Decoder = new Base64Decoder(); 
    decoder.decode( simage );
    decoded = decoder.toByteArray( );
    bgImage.data = decoded;
     setStyle(
    "backgroundImage", bgImage );
    ============
    But this generates the following error:
    ==========
    Error: Unable to load 'Image52'.
    at mx.skins::RectangularBorder/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\fr amework\src\mx\skins\RectangularBorder.as:237]
    at mx.skins.halo::HaloBorder/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\fram ework\src\mx\skins\halo\HaloBorder.as:222]
    at mx.skins::ProgrammaticSkin/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\f ramework\src\mx\skins\ProgrammaticSkin.as:421]
    at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\f ramework\src\mx\managers\LayoutManager.as:622]
    at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects \framework\src\mx\managers\LayoutManager.as:677]
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framew ork\src\mx\core\UIComponent.as:8628]
    at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framewo rk\src\mx\core\UIComponent.as:8568]
    ==============
    But passing a filename to setStyle works!!!!
    But I need the image to come from a database!!!!!!
    Help!

  • BackgroundImage bug?

    I'm having an issue with the backgroundImage style of a canvas and would appreciate any help.
    I have a tilelist with a selection of png images listed and when one is selected from the list it is set as the backgroundImage of a larger canvas on the page. Occasionally when selecting images quickly from the tilelist the canvas ends up displaying more than one of the png's.
    The png's are loading from a server and while they are small they don't load instantly. The issue seems to happen most often when selecting png's from the tilelist that haven't loaded yet.
    I have tried setting the backgroundImage with .setStyle() and by binding the backgroundImage property to a string and setting that string to the path to the image and both ways have the same problem.
    Any ideas as to how I can avoid or correct this?
    Thanks,
    Scott F.

    Is it not possible to gather nodes in groups? Or why dont have nobody an answer?
    Would be great to konw if it is possible in anyway to group nodes.
    Anyway to show that they are from one specific typ/group.
    Thanks anyway, even if there is no solution.

  • Problem with change of backgroundImage

    Hi,
    i'm new in Flex and i'm having a problem changing the
    backgroundImage property of a component.
    I create a component (Canvas) that changes it's
    backgroundImage on mouseOver and mouseOut events.
    The problem is that if i make a fast move with the mouse
    through the component, the backgroundImage doesn't disapear. It
    shows the image of the mouseOver event, but the image doesn't
    disapear when the mouseOut event set the other backgroundImage. We
    can see that the backgroundImage of the mouseOut event has been
    showed behind the mouseOver image, but the backgroundImage of the
    mouseOver event, hasn't been hidden.
    It doesn't happen only with the mouseOver image, it happens
    with the mouseOut image too. It also happens with the both image at
    the same time if i keep moving the mouse over and out the
    component.
    I did a lot of tests and noticed that it happens only with
    the backgroundImage property. If i change any other property of the
    component, it works fine in any mouse speed.
    I really don't know what to do.
    The code is very simple:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas
    backgroundImage="imagens/background_etiqueta.png"
    width="300"
    height="140"
    mouseOver="{mouseOverHandler(event)}"
    mouseOut="{mouseOutHandler(event)}"
    >
    <mx:Script>
    <![CDATA[
    private function mouseOverHandler(event:MouseEvent):void
    this.setStyle("backgroundImage",
    "imagens/background_etiqueta_selecionada.png");
    private function mouseOutHandler(event:MouseEvent):void
    this.setStyle("backgroundImage",
    "imagens/background_etiqueta.png");
    ]]>
    </mx:Script>
    </mx:Canvas>
    Does anyone knows anything about a Flex bug, browser bug or
    anything else ?
    OR
    Does anyone knows what am i doing wrong ?

    The client decides to which network it is connecting to. My guess is that the client is configured for both SSID's and that the client is switching between the two because of some slight signal strength difference. Are both SSID's enabled for the same radio bands? (so 802.11b/g/n and 802.11a/n/ac). Another option is that some connectivity is not possible on the corp SSID which triggers the client to look for a "better" network.
    In the end the solution to this problem is to (technically) prohibit your own clients to use the guest or change the security policy so that your users don't need to do this anyway. Then remove the configured guest profile on the clients (or change your guest SSID) so that they won't try to connect anymore.

Maybe you are looking for