Embed a JPEG image into a Flex application : Image « Graphics « Flex






Embed a JPEG image into a Flex application

Embed a JPEG image into a Flex application
            

<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



<!-- controls\image\ImageSimpleEmbed.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx">
    <mx:Image id="loader1" source="@Embed(source='a.jpg')" />
</s:Application>

   
    
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Use inline item renderer to display imageUse inline item renderer to display image
2.Bind Image to a variableBind Image to a variable
3.Explicit sizing for the Image control and default sizing for the Button controlExplicit sizing for the Image control and default sizing for the Button control
4.uses explicit sizing for the Image control and default sizing for the Button controluses explicit sizing for the Image control and default sizing for the Button control
5.Change Image source in button actionChange Image source in button action
6.Image as Button skinImage as Button skin
7.When the user clicks the button, the action sets the visible property of the image to true to make it appear
8.Use load() method to replace a small image with a large image when the user clicks a buttonUse load() method to replace a small image with a large image when the user clicks a button
9.Using GIF file as both a skin for the Button control and a source for the tag
10.Embedding three images and applies those images as skins to an instance of a Button controlEmbedding three images and applies those images as skins to an instance of a Button control
11.Button with Embedded imageButton with Embedded image
12.Maintain Image Aspect RatioMaintain Image Aspect Ratio
13.Add image based border skin for CanvasAdd image based border skin for Canvas
14.Load image from a URLLoad image from a URL
15.Working with different media typesWorking with different media types
16.Setting visibilitySetting visibility
17.Import a green square from a SWF file that contains a library of different shapes
18.Resize logo to the exact values of the height and width properties without regard for its aspect ratioResize logo to the exact values of the height and width properties without regard for its aspect ratio
19.Assigning an image to a variable to decouple its locationAssigning an image to a variable to decouple its location
20.Use Image control to display imageUse Image control to display image
21.Use a relative path to reference an image in an assets directoryUse a relative path to reference an image in an assets directory
22.Reference an image using a URLReference an image using a URL
23.Create image thumbnailsCreate image thumbnails
24.Set height and width of the image to 150 by 200 pixelsSet height and width of the image to 150 by 200 pixels
25.Resize Image to exact height and widthResize Image to exact height and width
26.x and y properties specify the upper-left corner of imagex and y properties specify the upper-left corner of image
27.Use ActionScript to set image propertiesUse ActionScript to set image properties
28.Use load() method to replace imageUse load() method to replace image
29.Text can flow around the imageText can flow around the image
30.Layout images in a CanvasLayout images in a Canvas
31.Png image based skinPng image based skin
32.Use Image control in an MXML fileUse Image control in an MXML file
33.skin based on png imagesskin based on png images
34.Do not maintain Aspect Ratio when displaying image with ImageDo not maintain Aspect Ratio when displaying image with Image
35.Use source for Image controls and other controls that point to an external fileUse source for Image controls and other controls that point to an external file
36.Compare Two Bitmap ImagesCompare Two Bitmap Images
37.Image source fileImage source file
38.Load image file for an Image control with load methodLoad image file for an Image control with load method
39.Image control io error
40.Image BindingImage Binding
41.Image DemoImage Demo
42.Set Image Source to change image file for an Image controlSet Image Source to change image file for an Image control
43.Load Image With Load method from a disk fileLoad Image With Load method from a disk file
44.Move ImageMove Image
45.Load image with Loader and Paint image with graphics
46.Display Images and SWFs in HTMLDisplay Images and SWFs in HTML
47.Load and Display an ImageLoad and Display an Image
48.Display a Custom Loader while Loading ImagesDisplay a Custom Loader while Loading Images
49.skin with imageskin with image
50.Use the backgroundImage style to specify an image as the background of the containerUse the backgroundImage style to specify an image as the background of the container
51.Access a JPEG image at run timeAccess a JPEG image at run time
52.Reference an image by using a URLReference an image by using a URL
53.By specifying a height and width of 20 by 20 pixels, you create a thumbnail of the image.By specifying a height and width of 20 by 20 pixels, you create a thumbnail of the image.
54.Load a simple image from a local locationLoad a simple image from a local location
55.Using the tag and how text can flow around the imageUsing the <img> tag and how text can flow around the image
56.Use @Resource directive anywhere a String might supply the location of the image.
57.Set image transform center to the right edge, corresponding to the transormX property having a value of 100Set image transform center to the right edge, corresponding to the transormX property having a value of 100
58.Image ClassImage Class
59.Read and Save a User's Webcam ImageRead and Save a User's Webcam Image