How to load .jpeg images dynamically

Hi all,
I am only perfect with basics of AS3 and flash. I need AS3
code or a basic example/tutorial for loading of .jpeg images into
flash from database.I had searched through google, but, any of the
example won't match.
Please, If anyone has their ideas, atleast send me the
algorithm for your idea, so that i can try by implementing the
idea.
I think, once again when I open this topic, i will be
getting my requirement.
Thanks a lot in advance. Reply me soon.. It is urgent..
Srihari.Ch

The loading is easy:
var l:Loader = new Loader();
l.load( new URLRequest( "
http://www.adobe.com/devnet/images/214x74/adc_lockup.jpg"
addChild( l )
But the database part, well... what kind of database did you
have in mind?
Store the images on disk and just have their path in the
database or have the images as blob in the database. Are you
looking for serverside script and SQL aswell? It's a question with
a lot of different answers...

Similar Messages

  • How to load jpeg images in database?

    I have an employees panel and it has a box to show employee's picture. Normally I double click on the box and it takes me to the folder where I have stored all employees jpeg file. I click on the one I need and then insert, it shows up on the panel and also saving the data in a table called PS_EMPLOYEE_IMAGE table.
    If I want to insert number of images at one time thru the back end like sqlplus is there a way to do it? This saves me lot of time instead of entering thru the panel. Can it be done? For example fot employee1 insert jpeg1, employee2 jpeg2 etc. DO I have to use any tool to convert these jpeg files into some other data and then insert it? Is there any pl/sql package to do it?. If some one can explain me with simple explanation I really appreciate as I am not an real oracle person. Googling for this issue says it can be done but it is not very clear in steps of doing it.

    Thanks for your help. I did exactly like what you described (see below)
    1) I created a image_file.txt file as shown below
    EMPLID|EFFDT|EFF_STATUS|IMAGE_FILE
    100000|08-FEB-2011|A|H:\SQL_Loader\George_Test.jpg
    100001|08-FEB-2011|A|H:\SQL_Loader\Eftihia_Test.jpg
    2) Then created EE_Image_Tbl.ctl file as shown below.
    OPTIONS (DIRECT=TRUE, SKIP=1)
    UNRECOVERABLE
    LOAD DATA
    APPEND
    INTO TABLE PS_EMPLOYEE_IMAGE
    FIELDS TERMINATED BY '|'
    (EMPLID
    ,EFFDT
    ,EFF_STATUS
    ,IMAGE_FILE FILLER CHAR(80)
    ,EE_IMAGE LOBFILE(IMAGE_FILE) TERMINATED BY EOF)
    3) then used the sql loader (load_ee_image.sql)
    $ sqlldr DH5M/ep5evs1@KDH5MI01 control=h:\sql_loader\EE_Image_Tbl.ctl log=h:\sql_loader\load_ee_image.log data=h:\sql_loader\image_file.txt
    SQL> --*
    SQL> commit;
    Commit complete.
    SQL> --*
    SQL> @h:\sql_loader\load_ee_image.sql;
    SQL> $ sqlldr DH5M/ep5evs1@KDH5MI01 control=h:\sql_loader\EE_Image_Tbl.ctl log=h:\sql_loader\load_ee_image.log data=h:\sql_loader\image_file.txt
    SQL> --*
    SQL> --*
    SQL> --*
    SQL> commit;
    Commit complete.
    SQL> --rollback;
    SQL> --*
    SQL> spool off
    L
    Number to skip: 1
    Errors allowed: 50
    Continuation: none specified
    Path used: Direct
    Load is UNRECOVERABLE; invalidation redo is produced.
    Table PS_EMPLOYEE_IMAGE, loaded from every logical record.
    Insert option in effect for this table: APPEND
    Column Name Position Len Term Encl Datatype
    EMPLID FIRST * | CHARACTER
    EFFDT NEXT * | CHARACTER
    EFF_STATUS NEXT * | CHARACTER
    IMAGE_FILE NEXT 80 | CHARACTER
    (FILLER FIELD)
    EE_IMAGE DERIVED * EOF CHARACTER
    Dynamic LOBFILE. Filename in field IMAGE_FILE
    SQL*Loader-418: Bad datafile datatype for column EE_IMAGE
    This is becasue my image datatype can be declared as LONG RAW dara type thru my application.
    When I created a table with image datatype as BLOB it worked.
    But I want to insert into the existing table where image is declared as LONG RAW. How to insert jpeg into this field. Do I have to convert anything? Thx.
    Edited by: user5846372 on Feb 8, 2011 1:18 PM
    Edited by: user5846372 on Feb 8, 2011 2:16 PM

  • How to load mutiple image

    I'm trying to create a photo manager but I can't find a way to load multiple images onto my frame. I have a thumbnail class that makes thumbnails for an image (which is a modified version of the class ImageHolder from FilthyRichClient)
    public class Thumbnails {
         private List<BufferedImage> scaledImages = new ArrayList<BufferedImage>();
    private static final int AVG_SIZE = 160;
    * Given any image, this constructor creates and stores down-scaled
    * versions of this image down to some MIN_SIZE
    public Thumbnails(File imageFile) throws IOException{
              // TODO Auto-generated constructor stub
         BufferedImage originalImage = ImageIO.read(imageFile);
    int imageW = originalImage.getWidth();
    int imageH = originalImage.getHeight();
    boolean firstScale = true;
    scaledImages.add(originalImage);
    while (imageW >= AVG_SIZE && imageH >= AVG_SIZE) {
         if(firstScale && (imageW > 320 || imageH > 320)) {
              float factor = (float) imageW / imageH;
              if(factor > 0) {
              imageW = 320;
              imageH = (int) (factor * imageW);
              else {
                   imageH = 320;
                   imageW = (int) (factor * imageH);
         else {
              imageW >>= 1;
         imageH >>= 1;
    BufferedImage scaledImage = new BufferedImage(imageW, imageH,
    originalImage.getType());
    Graphics2D g2d = scaledImage.createGraphics();
    g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    g2d.drawImage(originalImage, 0, 0, imageW, imageH, null);
    g2d.dispose();
    scaledImages.add(scaledImage);
    * This method returns an image with the specified width. It finds
    * the pre-scaled size with the closest/larger width and scales
    * down from it, to provide a fast and high-quality scaled version
    * at the requested size.
    BufferedImage getImage(int width) {
    for (BufferedImage scaledImage : scaledImages) {
    int scaledW = scaledImage.getWidth();
    // This is the one to scale from if:
    // - the requested size is larger than this size
    // - the requested size is between this size and
    // the next size down
    // - this is the smallest (last) size
    if (scaledW < width || ((scaledW >> 1) < width) ||
    (scaledW >> 1) < (AVG_SIZE >> 1)) {
    if (scaledW != width) {
    // Create new version scaled to this width
    // Set the width at this width, scale the
    // height proportional to the image width
    float scaleFactor = (float)width / scaledW;
    int scaledH = (int)(scaledImage.getHeight() *
    scaleFactor + .5f);
    BufferedImage image = new BufferedImage(width,
    scaledH, scaledImage.getType());
    Graphics2D g2d = image.createGraphics();
    g2d.setRenderingHint(
    RenderingHints.KEY_INTERPOLATION,
    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    g2d.drawImage(scaledImage, 0, 0,
    width, scaledH, null);
    g2d.dispose();
    scaledImage = image;
    return scaledImage;
    // shouldn't get here
    return null;
    A loop will loop through a collection of files and pass them to the constructor of Thumbnails to create thumbnails and then set them as icon for JLabels that will be added to a JPanel, but it throws a java.lang.OutOfMemoryError at this line:
    BufferedImage originalImage = ImageIO.read(imageFile);
    even when there're only about 8 image files in the collection (total size 2,51MB).
    I've seen other people's software that could load hundreds of photos in a matter of seconds! How do I suppose to do that? How to load mutiple images efficiently? Please help!! Thanks a lot!

    another_beginner wrote:
    Thanks everybody! I appreciate your help! I don't understand why but when I use a separate thread to do the job, that problem disappear. You were likely doing your image loading and thumnail creation on the Event Dispatching Thread. Among other things, this is the same thread that updates and paints your panels, frames, buttons, ect.. When a programer does something computationaly expensive on the event dispatching thread then the GUI becomes unresponsive until the computation is done.
    Ideally what you want to do is load images and create thumnails on a seperate thread and update your GUI on the event dispatching thread. I supect that while you are finally doing the first item, you might now be violating the second item.
    Whatever, the program seems to be pretty slow on start up 'cause it have to reload images everytime. I'm using Picasa and it can display those thumbnails almost instantly. I know that program is made by professionals. But I still want to know how.I took a look at this Picasa you mentioned. It's the photo manager from google right? You're right in that the thumnails display instantly when starting up. This is because Picasa is actually saving the thumnails, instead of creating them everytime the program starts up. It only creates the thumnails once (when you import a picture) and saves the thumnail data to " +*currentUser*+ /AppData/Local/Google/Picasa2/db3/" (at least on my computer --> Vista).
    Also, if your looking for speed then for some inexplicable reason java.awt.Toolkit.getDefaultToolkit().createImage(...); is faster (sometimes much faster) than ImageIO.read(...). But there comes a price in dealing with Toolkit images. A toolkit image isn't ready for anything until it has been properly 'loaded' using one of several methods. Also, when you're done and ready for the image to be garbage collected then you need to call Image.flush() or you will eventually find yourself with an out of memory error (BufferedImages don't have this problem). Lastly, Toolkit.createImage(...) can only read image files that the older versions of java supported (jpg, png, gif, bmp) .
    And, another question (or maybe I should post it in a different thread?), I can't display all thumbnails using a JPanel because it has a constant height unless I explicitly set it with setPreferredSize. Even when put in a JScrollPane, the height doesn't change so the scrollbar doesn't appear. Anyone know how to auto grow or shrink a JPanel vertically? Or I have to calculate the preferred height by myself?Are you drawing the thumnails directly on the JPanel? If so then you will indeed need to dynamically set the preferred size of the component.
    If not, then presumebly your wrapping the thumnails in something like a JLabel or JButton and adding that to the panel. If so, what is the layout manager you're using for the panel?

  • How to load a image after getting it with a file chooser?

    I'm still starting with JavaFX, and I simply would like to know how to load the image (e.g. png or jpg) that I selected using a FileChooser in the user interface. I can access the file normally within the code, but I'm still lost about how to load it appropriately. Every time I select a new image using the FileChooser, I should discard the previous one and consider the new one. My code is shown below:
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.paint.Color;
    import javafx.scene.layout.HBox;
    import javafx.scene.control.Button;
    import javax.swing.JFileChooser;
    import javafx.scene.image.ImageView;
    import javafx.scene.image.Image;
    var chooser: JFileChooser = new JFileChooser();
    var image;
    Stage {
        title: "Image"
        scene: Scene {
            width: 950
            height: 500
            content: [
                HBox {
                    layoutX: 670
                    layoutY: 18
                    spacing: 10
                    content: [
                        Button {
                            text: "Open"
                            action: function() {
                                if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(null)) {
                                    var imageFile = chooser.getSelectedFile();
                                    println("{imageFile.getCanonicalFile()}");
                                    image = Image{
                                        width: 640
                                        url:imageFile.getAbsolutePath()
                // Image area
                Rectangle {
                    x: 10
                    y: 10
                    width: 640
                    height: 480
                    fill: Color.WHITE
                ImageView {
                    x: 10
                    y: 10
                    image: bind image
    }Thank you in advance for any suggestion to make it work. :)

    As its name implies, the url param expect... an URL, not a file path!
    So, use {color:#8000FF}url: imageFile.toURI().toURL(){color} instead.

  • How to change the images dynamically in a table.

    Hai,
                     How to change the images dynamically in a table based on the condition in webdynpro abap.
    Edited by: Ravi.Seela on Oct 13, 2011 2:17 PM

    This has been much discussed earlier. Do search posts.
    For your scenario i would do the following.
    inside your node which is binded to the table, i create a new node image with cardinality 1 ..1 and a attribute called path of type string.
    create a  supply function for the node image .
    Supply method now has a Element (Parent element ) and node.
    Based on your record in element, set the right image source to path attribute and bind the node.
    This will make sure that the framework calls the image supply function for every row in a table.

  • How to store jpeg images in SQL server using NI database Connectivity Toolset. Can anyone please help me in this regard.

    Please tell how to store jpeg images in SQL Server using NI Database Connectivity Toolset.

    http://www.w3schools.com/sql/sql_datatypes.asp
    You setup a field as BLOB and store the binary of the picture there. Depending on the database it can be called differently as you can see in the link, in SQL server there's even a Image datatype.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • How to uploag jpeg image for smartforms

    how to uploag jpeg image in sap. plz tell me the steps.
    Edited by: Matt on Nov 16, 2008 4:15 PM

    Hi
    Convert the jpeg into bmp or bitmap...as from se78 jpeg cannot be uploaded. To convert, all you have to do is open the jpeg picture using paint brush and then save it as bmp. When you click save as in paint brush, it will open a window..in that in "Files of Type" select bitmap image and upload it.
    In smartform, create a graphic window and give this image name.
    Regards,
    Vishwa.

  • How to load an image into blob in a custom form

    Hi all!
    is there some docs or how to, load am image into a database blob in a custom apps form.
    The general idea is that the user has to browse the local machine find the image, and load the image in a database blob and also in the custom form and then finally saving the image as blob.
    Thanks in advance
    Soni

    If this helps:
    Re: Custom form: Take a file name input from user.
    Thanks
    Nagamohan

  • How to load a Class Dynamically?

    hi,
    I have the following problem.I am trying to load a class dynamically.For this I am using ClassLoader and its Loadclass method.My code is like this,
    File file = filechooser.getSelectedFile();
    ClassLoader Cload = this.getClass().getClassLoader();
    String tempClsname= file.getName();
    Class cd =Cload.loadClass(tempClsname);
    Object ob =(Object)cd.newInstance();
    showMethods(ob);
    In showMethods what i am doing is getting the public methods of the dynamically loaded class,
    void showMethods(Object o){
    Class c = o.getClass();
    System.out.println(c.getName());
    vecList = new Vector();
    Method theMethods[] = c.getDeclaredMethods();
    for (int i = 0; i < theMethods.length; i++) {
    if(theMethods.getModifiers()==java.lang.reflect.Modifier.PUBLIC)
    String methodString = theMethods.getName();
    System.out.println(methodString);
    vecList.addElement(methodString);
    allmthdlst.setListData(vecList);
    Now whenever i work with this i m getting a runtime error of CLASS NOT FOUND Exception..I know its because of Classpath..But i don't know how to resolve it??pls help me in this regard...
    Also previously this code was working with java files in the directory in which this java file was present..How to make it work for java file in some other directory..pls help me in this regard...
    Thanks in advance..

    You sure didn't need to post this twice.
    http://forum.java.sun.com/thread.jsp?thread=522234&forum=31&message=2498659
    When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read and prevents accidental markup from array indices like [i].
    You resolve this problem by ensuring the class is in the classpath and you refer to it by its full name.
    &#167;

  • How to load a class dynamically and then a call a method?

    Hi
    I want to call a method from a class,which class is loaded dynamically.
    Consider a classA and ClassB..
    ClassB contains a method showvalue() which returns a String value.
    I want to load a ClassB dynamically in ClassA,and call the method showvalue() and print the returned value of that method (showvalue).
    How to do this?
    Thanks

    Since you found your way to Reflections and Reference Objects, I can only assume you know that reflection is the answer. Since the reflection tutorial on this site, and indeed, the many others on the web, can explain this a whole lot better and more consisely than can be done in a forum, I'll point you in that direction instead. As a starting point, and to show I'm not just fobbing you off, you're interested in the classes java.lang.Class, java.lang.reflect.Method, and the method Class.getMethod(String, Class[])

  • Can anyone tell me how to load an image to custom shape in Photoshop? I can't save it as csh...

    I've made an image, as the watermark of our photos, but I can't load it to Custom Shape in PS CS4 as I can't save it as csh. Do you know how to upload an image type file that is not csh? Or how to convert the image to csh? Thanks.

    As Chris says, you can't make it into a custom shape unless you create it as a path. But you can save it as a Custom Brush (in monochrome).

  • Loading multiple images dynamically

    hi,
    trying to load several images to timeline keyframes,
    managed to load one, how to load several,
    Here´s the code:
    var imageLoader:Loader;
    function loadImage(url:String):void {
    imageLoader = new Loader();
    imageLoader.load(new URLRequest(url));
    imageLoader.contentLoaderInfo.addEventListener(Pro gressEvent.PROGRESS, imageLoading);
    imageLoader.contentLoaderInfo.addEventListener(Eve nt.COMPLETE, imageLoaded);
    loadImage("Images/pori1.jpg");
    function imageLoaded(e:Event):void {
    imageArea.addChild(imageLoader);
    function imageLoading(e:rogressEvent):void {

    hi,
    I appreciate if I would get some more advice on this.
    I´m trying to load each image to a frame(instance/imageArea1,2,3...) and to be loaded when needed (using next- or previous -buttons).
    Here´s my code so far:
    stop();
    var imageLoader:Loader;
    var images:Array = new Array("Images/pic1.jpg","Images/pic2.jpg");
    for(var i:uint = 0;i<images.length;i++){
    var request:URLRequest = new URLRequest(images[i]);
    var loader:Loader = new Loader();
    loader.x = i * 100;
    loader.load(request);
    this.addChild(loader);
    package KC {
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    public class NextBtn extends MovieClip {
    public function NextBtn():void {
    buttonMode = true;
    addEventListener(MouseEvent.MOUSE_DOWN, btnEvent);
    function btnEvent(evt:MouseEvent):void {
    MovieClip(parent).gotoAndStop(MovieClip(parent).currentFrame + 1);
    package KC {
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    public class PrevBtn extends MovieClip {
    public function PrevBtn():void {
    buttonMode = true;
    addEventListener(MouseEvent.MOUSE_DOWN, btnEvent);
    function btnEvent(evt:MouseEvent):void {
    MovieClip(parent).gotoAndStop(MovieClip(parent).currentFrame - 1);

  • How to change the image dynamically depend upon the input parameter

    Hi All
    I have one report running depend upon the Organization specific, I have 15 operating unit and 15 different logo for each operating unit.
    How to change the Logo dynamically depend upon the input passed by the user.
    If I have three or four logo i can add in my layout using if else statement and its works fine but i have more that 10 logos so its no possible to keep these in My RTF Template.
    Is it possible to change the logo according to the input without keeping this in Template.
    I have seen this link but its not working fine
    http://erpschools.com/articles/display-and-change-images-dynamically-in-xml-publisher
    Regards
    Srikkanth.M

    Hi,
    I have not completed fully,so sorry i cant able to share the files, could you please give me some tips and steps to do.
    Without having the logo in RTF if it possible to bring the logo depends on the user input (Ie Operating unit).
    Regards
    Srikkanth

  • How to convert jpeg image  into vector

    I have jpeg  image which contains line and circle. i want  to convert this image as a vector  and  i need to export  into DXF file format.
    In my illustrator i am not able to find live Trace option. how to enable live trace option.
    can anyone  help me to convert this,because  i am new to Adobe Illustrator.
    Thanks  in Advance.

    If you do want to use the image trace option here is how you do it:
    If you have nothing selected your contextual menu should look something like this:
    If you have your image selected your contextual menu will look like this.
    You can use the image trace from that button. to find it through the menu go here:

  • How to convert jpeg images into video file of any ext using JMF

    I want to convert the Jpeg files into video clip with the help of JMF
    any one can help me?
    Plz reply me at [email protected]
    or [email protected]

    I'm not sure of his/her reasoning behind this, but I have yet to find a way to record video with mmapi on j2me. So with that restriction, I can see how one could make it so that it just records a lot of jpegs, and then makes it a movie.
    I would be interested finding a workaround for this too. Either if someone would explain how to record video with mmapi or how to make recorded images into a video. Thanks!

Maybe you are looking for

  • Suddenly, messages are not displaying correctly, how can I cure this?

    Messages have stopped displaying correctly, or, in some case, at all. The messages have downloaded OK. Even messages which were displaying correctly earlier, now don't. It occurred after 'finger' problems - I tried to type something into Firefox but

  • Flash Player in Windows 8.1 64 bit problems .....

    Hi. I have just installed Windows 8.1, but have problems with the embedded Flash Player in Internet Explorer. Starting Internet Explorer from the Desktop causes no problems. In particular (in case this has any bearing), going to BBC.co.uk, Sport,Form

  • Filtering out non assigned category

    I want to create a query from a multicube.  Can I filter out the not assigned node from queries? Thanks

  • LOAD_PROGRAM_NOT_FOUND RSSTAT10

    Dears, after we upgrade our system to netweaver 7.0, we receive the following dumps in the systme: LOAD_PROGRAM_NOT_FOUND Program "RSSTAT10" not found Since neighter the marketplace or SDN seem to have a solution, can someone help me out on this one

  • Photos from HTC DNA to windows 8

    How do I transfer photos from my HTC DNA to my laptop with windows 8?