Image control source attribute

I would like to protect my source files such as images from being downloaded or directly referenced by a URL by somebody other than my program. I thought may be an easy way to do that would be if I set the source to outside my webfolders. But my understanding is that in an Image control, the value of the property source has to be under my web root folder. Is there a way I can set the source to outside of my web folder and still have my flex app render the image od does some one have a different way of achieving the same objective. Thanks, Ramesh

Hi there
You can embed your image on the application.
On FlexBuilder project, add a new source directory with your images... and in your source code some like this:
<mx:Script>
<![CDATA[
[Embed(source="image/yourImage.png")]
[Bindable]
public var myImage : Class;
]]>
</mx:Script>
<mx:Image source="{myImage}"/>
Regards

Similar Messages

  • Setting Image control source to image in IsolatedStorage.

    Hi. I capture an Image and save it to IsolatedStorage. What's the URI (source for Image control) for IsolatedStorage to automatically display that image if it's available in IsolatedStorage? Thank you in advance.

    Try this code to retrieve the image from isoStore.
    It works for me.
    using (IsolatedStorageFile iso = IsolatedStorageFile.GetUserStoreForApplication())
    if (iso.FileExists(string.Format("image.png")))
    string fileName = "image.png";
    string filePath = iso.GetType().GetField("m_RootDir", System.Reflection.BindingFlags.NonPublic |
    System.Reflection.BindingFlags.Instance).GetValue(iso).ToString() + fileName;
    You can set the source of the Image to filePath and you won't have any problem accessing it.
    If this doesnt work, then the problem is while you are saving the image. You might have to find a workaround for saving the canvas to png or jpeg.
    If my reply answers your question, please mark this post as answered.

  • Changing Image Control source

    If I am changing the image in an Image component on the fly
    by using either the "load" method or setting the "source" property,
    is there anyway to accomplish this without seeing some flashing
    while the new image is painted on the screen?
    Thanks!

    Hello Suresh,
    Are you loading multiple images at once on one page? If so this is an expected behavior. There is limited memory available per app so it's important to not load too large or too many photos at once in your app.
    If possible you can try to convert your Windows Phone 8 to Window Phone 8.1 so as to take advantage of the FlipView control which is built to handle photo gallery-like applications.
    Also you can always run the Windows Phone Application Analysis tool to check on the application performance and memory usage. This will help you test and fine tune your app accordingly.
    Let me know if this helps.
    Abdulwahab Suleiman

  • Image control

    I have a table including image content as xstring type and image type.
    I wanna display the image content on a wd image control.
    Is it possible?
    I knew the image control displays a certain image as url source.
    How can I display the image content in a table on WD view?
    Regards Jun

    I solved this problem thanks to your help using cache.
    I sent the image content to cache area and then created a temporary cache url.
    The url is bound to image control' source.
    Everything is OK now. Thank you for your Idea.

  • Image control with a movieclip source

    I have an image control sitting inside a panel. The images
    source is a movieclip. When I change the change the size of the
    movie clip (scale X, scale Y) the movie clip exceeds the boundary
    of the image and the panel, so no scroll bars are shown. Can anyone
    shed some light on this? I'm stumped.

    Hey Guys,
    A couple things:
    We don't have preloader scripts, but the way I do it is to
    load them from a regular data set and put them into a hidden DIV. I
    use that here:
    http://www.dbooth.net/photos/index.htm?location=italy2007#
    The thumbnails are loaded into a DIV that is hidden. They are
    then available as previews when you mouseover the numbers.There is
    a lag of course, since that do have to load at some time.
    As for MySQL scripts, we have a util file here:
    http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html
    We have two versions for each language: One that will just
    auto-convert a query and another that allows you to create your own
    node names.
    Let me know if you have questions.
    Don

  • Open a disk image file and crop it to an Image control

    Hi Folks,
    I am trying to allow my users (in a browser) to select/open a disk file (image type) so that they can see it and then save it to the server.  I can use the FileReference object just fine, and load its 'result' directly into a MX:Image control.  However, before I do that I would like to crop the selected imaged to a square shape.  I'd also like to resize the image down, but that will come later, once I get the cropping working.
    I am essentially taking the FileReference result bytearray and converting that to a BitmapData object.  Then, I 'extract' a square of data from that BitmapData object into a new BitmapData object.  Then I need to get *that* BitmapData object into the mx:image control.  I tried using a Bitmap to do so, however the resulting mx:image, while 'sized' correctly, displays as a blank white region.  All along, the variables seem to be 'full' of data and seem to have properly set attributes.  I've looked up quite a few sites that demonstrate cropping, and copying images, but they always start out with 'pre-loaded' images.  I have modeled my code after theirs, where appropriate.
    Here is my code:
              //this gets called when the user clicks a button to 'look for a disk file'
                private function setPhoto():void
                    //create the FileReference instance
                    _fileRef = new FileReference();
                    _fileRef.addEventListener(Event.SELECT, onFileSelected);
                    //listen for the file has been opened
                    _fileRef.addEventListener(Event.COMPLETE, onFileLoaded);
                    var arr:Array = [];
                    arr.push(new FileFilter("Images", ".gif;*.jpeg;*.jpg;*.png"));
                    _fileRef.browse(arr); //then let go and let the event handlers deal with the result...
                private function onFileSelected(evt:Event):void
                    _fileRef.load(); //the result of the 'load' will be handled by the 'complete' handler
                private function onFileLoaded(evt:Event):void
                    var tempLoader:Loader = new Loader();
                    tempLoader.loadBytes(_fileRef.data);
                    tempLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete);
                    //imgPhoto.source = _fileRef.data;  //this would work just fine, though, it wouldn't be cropped
                private function onLoaderComplete(event:Event):void
                    var loaderInfo:LoaderInfo = LoaderInfo(event.target);
                    var loadBD:BitmapData = new BitmapData(loaderInfo.width,loaderInfo.height);
                    //ok, now that we have the 'original' file in the bitmap data, we can crop it and then later resize it
                    //so, we need a 'square' of image cropped out of the original
                    //so...first we get a square of the 'full size' image
                    //if the image is taller than wide, we will take a square as wide as the image, and as tall as it is wide, starting 5% down from the top
                    //if the image is wider than tall, we will take a square as tall as the image, and as wide as it is tall, from the horizontal middle
                    var curW:int = loadBD.width;
                    var curH:int = loadBD.height;
                    var cropX:int = 0;
                    var cropY:int = 0;
                    var cropW:int = curW;
                    var cropH:int = curH;
                    var needCrop:Boolean = true; //default is to crop
                    var croppedBD:BitmapData;
                    if (curH > curW)
                        cropY = Math.round(curH * .05); //start at 5% down
                        cropH = cropW;
                    else if (curW > curH)
                        cropX = Math.round(curW/2) - Math.round(curH/2); //start at the middle, go 'back' by half the height
                        cropW = cropH;
                    else
                        needCrop = false; //it's already a square!  nothing to do (aside from the resize)
                    if (needCrop)
                        croppedBD = new BitmapData(cropW, cropH); //at this point it is 'empty', so fill it up
                        var fillPoint:Point = new Point(0,0); //since we're gonna fill into the top, left pixel on down and over
                        var fillRect:Rectangle = new Rectangle(cropX,cropY,cropW,cropH);
                        croppedBD.copyPixels(loadBD,fillRect,fillPoint);
                    else
                        croppedBD = loadBD;
                    imgPhoto.source = new Bitmap(croppedBD);  //this produces a properly sized, but blank-white image
    And here is the mxml for the image:
    <mx:Image id="imgPhoto" x="40" y="126" maxWidth="200" maxHeight="200" />
    Thanks!
    -David

    Hi,
    You were close to the solution.
    In "onLoaderComplete(event:Event):void", at the begining you create a BitmapData called "loadBD", you just forgot to fill it with the content from the loaderInfo.
    private function onLoaderComplete(event:Event):void {
         var loaderInfo:LoaderInfo = LoaderInfo(event.target);
         var loadBD:BitmapData = new BitmapData(loaderInfo.width,loaderInfo.height);
         loadBD.draw(loaderInfo.content);
    Kind regards,
    Mich

  • Image control runtime creation issue

    I am having problems getting the Image control to actually
    display the image I specify in the source property. The Image
    control is created in actionscript at runtime based on XML returned
    by an HTTPService request. I have a canvas that I want to populate
    with Label, Text, Image, LinkButton, etc. controls based on the
    contents of the XML file that is read in, so I have to create all
    the components on the fly and use something like this:
    var newImage:Image = new Image();
    newImage.setStyle("source", "images/myImageFile.jpg");
    myCanvas.addChild(newImage);
    After I get all the newly created components added as
    children to the canvas I go back through and do positioning
    (something like this):
    for each (var child:DisplayObject in myCanvas.getChildren())
    //set the y property of each component to the y of the
    previous child plus
    //the height of the previous child plus 10 px margin
    Wherever there is an image in my XML it inserts the 10px
    margin for that component, so I know it's creating it and that it
    gets added as a child, but for some reason the image is not
    displaying and so the height of the component is 0. I even tried
    hardcoding the height of each Image control in case the image was
    there but it just wasn't sizing right, but it puts in the space
    without displaying the image.
    What I'm wondering is if there is some method that will force
    the Image controls to either load the image or render it. When I
    add an Image in mxml and use the exact same source data it displays
    just fine, so the file path is correct. I also have the same images
    being read in from XML off the HTTPService that are showing up just
    fine in a TileList where my itemRenderer component has an image
    with the source set to the same path as I'm trying to use in the
    runtime-generated Image controls.
    Also, as a side question, does anyone know why a lot of the
    properties/methods available from mxml specified comonents aren't
    available when you create variables of the same type in
    actionscript? For example, if I have
    <mx:Image id"img"/>
    I can go back in actionscript and reference img.source just
    fine. On the other hand, if I declare an Image in actionscript,
    thus:
    private var asImg:Image = new Image();
    and then try to refer to the source property like so:
    asImg.source
    it doesn't show up in the code hinting and it also throws an
    error on compile (reference to a possibly undefined property source
    for bla bla bla)
    Actually, I've noticed that a lot of the properties and
    methods of various components aren't available when they are
    actionscript rather than mxml. I didn't see much in the
    documentation on the difference or what could be done to work
    around it.
    Thanks much anyone who has input.

    Ok, got it.
    I figured that since the <mx:Image> renders just fine
    and that the ActionScript Image object doesn't that I'd just create
    a custom mxml component with Image as the base element and with
    nothing else in it. Then I add an instance of my custom image
    component in AS whenever the XML specifies one. The layout was a
    bit of an issue, but I just added the image dimensions as
    attributes in my XML and size the CustomImage component based on
    those.
    Must be some subtle difference between the mxml and AS Image
    classes that isn't documented very well.

  • How to add an image to an IMAGE control in Java WebDynpro

    hi
    How to add an image to an IMAGE control in Java WebDynpro.
    Please give me the steps to assign an image to an IMAGE control.
    Advanced Thanks
    brahma

    Thank You Mathan MP,
    i tried these steps, but whenever i selected the source property of image UI control, it opens a context window, but this context window does't contain any thing for selection.
    so how to solve this problem ?
    the link whatever u provided is not opened, please send the correct link.
    http://127.0.0.1:1284/help/index.jsp?topic=/com.sap.devmanual.doc.user/f3/1a61a9dc7f2e4199458e964e76b4ba/content.htm
    Thanks in Advance
    brahma

  • Resetting an image control

    When one assignes Image.source using a Bitmap reference the
    Image's properties (primarily the read only properties such as
    contentWidth etc. to do with the height and width of an image) are
    not reset (using the information in the Bitmap) as a result it is
    virtually impossible to get the results required.
    I'll try and explain the problem:
    When you use:
    Image1.source = "SomeUrlHere"
    The internal properties of the image (particularly to do with
    width and height aspects of the image) get reset to those from the
    source just loaded.
    However, if you use:
    Image1.source = SomeBitmapReference
    You don't get the same behaviour. This has an imapct if you
    intend to use the same Image control over and over for many images.
    An example of such a use would be a bunch of thumbnails in an image
    gallery that when clciked on show up full size in the "main" image
    control. Of course all images don't have the same height and width
    and nor do they have the same width to height ratio. The main image
    control in this case sizes to a smaller and smaller size and
    eventually sizes down to zero. If you use the url to the image
    (instead of a Bitmap reference) everything works as expected.
    In my mind this is a bug. However if anyone has a work around
    this or solution to this I'd appreciate it tremendously.
    Thanks.
    Shiv.

    Can anyone help me achive this?

  • Supress image in Drag operation from af:image Drag Source

    We have a image with client Attribute that is used as AttributeDrag Source
    jsff snipped looks like this
    <af:image id="image1" ....... source= ........
    <af:clientAttribute name="SymbolId"
    value= .......
    <af:attributeDragSource attribute="SymbolId"/>
    </af:image>
    When user does a drag from this image, by default, user sees the same image being dragged
    We need to suppress the image and just show a + icon while drag is in progress.
    Any pointers ?
    Thanks,
    Jaspal

    I understand this is the default behavior.
    To clarify the Use Case, we drag from adf image into a flex region. Once drag enters flex, flex fetches a different image for the object being dragged
    User sees 2 images when drag enters flex, a ghost image coming from adf and the correct scaled down image from flex. We need to suppress the ghost image from adf
    Looking for workaround (maybe javascript) to suppress the ghost image and just show a + icon while drag is in progress

  • How to get an image's source in safari?

    I need the image location/source for a picture, but I can't find a command for Safari to do this. Please help!

    Following paul2363's instructions, you will be able to read the image's location in the address bar.
    Alternatively, you can Control-click on the image and choose "Copy Image Address" from the contextual menu. Then paste the resulting URL wherever you need it.

  • How to use an Event Structure responding to an image control that belongs to a parent VI.

    Hi
    I am loading a subpanel vi by pressing a button located in the user interface of the main vi which also contains an image display. Subpanel vi opens up on the side and doesn't hide the image display of the main vi. Subpanel vi contains an event structure that needs to respond to user clicking on the image display of main vi.
    Since the bug that occured while creating an image reference control isn't fixed, I am passing the main vi pane reference onto the subpanel vi. From that point I've tried to edit event structure and have it respond to the image control/pane that belongs to main vi but I don't know how.
    Any help would be appreciated.
    Thanks

    Post a screenshot of your subVI code where you register the events.
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • HOWTO: Control Printer Attributes for a Report at Run Time Reports 6i

    HOWTO: Control Printer Attributes for a Report at Run Time
    Like page width , height etc
    my problem is i had installed a printer and it is set for
    printing different reports ( like invoice slips , legal size ,
    A3 etc ) each time i have to manually set the page settup from
    printer folder .instead if there is an option to set the printer
    attributes from Reports 6i it is great
    rajesh

    All the Printer Setup(Page Height and Page Width) must be set in
    the Reprot Program. These can be set at the Layout-Main Section
    in the Object Navigator.
    hth

  • BADI_CRM_BP_FILTER_ATTRIBUTE  implementation to control field attributes

    Hi,
    I have a requirement to control field attributes of Business partner or customer based on user role, like make some fields display for most of the roles.
    I found this BADI in SAP notes, but it does not allow to create my new implementation like normal BADI impl.
    There is already standard BADI implementation in CRM_UIU_BP_ENHANCEMENT enhancment set. Would you please suggest how to use this BADI for my custom checks and filtering. I also do not see any parameter that has attribute values so that i can control them in standard implementation.
    Thanks.
    With regards,
    Ravi

    Hi,
    Let me rephrase the question. The requirement is to maintain  BP attributes like City, country as display fields only for some roles like Sold-to-party and  editable for other roles like contact person  when agent logs in say with custom business role say sales employee.
    With UI configurtion, i think the possibility is to make a field either editable or  display for both sold to party and contact person BP roles. I am trying to find solution to meet the requirement. Any suggestions are welcome. Thanks in advacne.
    With regards,
    ravi

  • 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.

Maybe you are looking for

  • Install Agent12c on Windows Server 2008 R2

    Hi All, I have to install Agent12c on on Windows Server 2008 R2, already there is Oracle 10g agent installed on the system. The OMS Server is a linux system. I am not able to find the setup of Agent12c for Windows Platform. Please help in this instal

  • How do I view tracks of an album in version 11.0.4.4?

    With the new updates to itunes, I've been avoiding itunes, because I don't like them However, I just got a new CD, imported it into itunes...but now when I click on the album, it just plays the first track. I have no idea how to find any of the other

  • [Fatal Error] :1:1: Content is not allowed in prolog.

    I'm trying to compare an XML file to an XSLT generated file from that XML file, and when I run the the class as a JUnit Test, I get the following: [Fatal Error] :1:1: Content is not allowed in prolog. org.xml.sax.SAXParseException: Content is not all

  • PO Confirmations with Multiple Line items

    Hi Experts, In our Business Scenario, the Purchase Order Confirmations are being received by IDoc from Vendors. IDoc Basic Type is ORDERS01. Issue is when we have one PO line item, then the IDoc is getting processed successfully. But when we have Mul

  • Which API need to call to update oracle database

    Hi, Does anybody know which APIs should be called in which order to update the oracle database base on the payroll run result conducted by 3rd party payment system? reply to [email protected] will be highly appreciated! Thankss