How to load an image from local disk?

Hi!
I have spent hours on the net searching for an example, that
could
show me how could I make a flex script that user could browse
(like fileReference.browse() ) for a
file (picture) and then show this picture in the browser (so
the source of some existing picture would change).
I found only multiple solutions on how to upload a picture,
but
that is not the thing I wanna do. I want a user to load a
picture from
his disk and simply to be seen in a browser (on a page).
I tried programming it alone, but the FileReference class has
no attribute path or similar, that I could use for source of my
image.
Please help, I need to do this urgently.
Thank you very very much
Gus

OK, I tried without FileReference, simply by changing String
variable of the source path when calling image.load(path), but it
works ONLY FOR REMOTE pictures (online), I also tried with
[Bindable]
[Embed(source="C:/somePicture.jpg")]
public var _img0:Class;
, but it appears that you CANNOT CHANGE THE PATH DOURING
EXECUTION (dinamically)
So please, someone?
Is it even possible to do that?
I could try uploading picture and then downloading, but why
would I need a server side if I don't need it...
Help

Similar Messages

  • How to load an image from local filesystem, and paint it to a frame

    Please offer an AWT solution

    Image getImage
        String path
        Image image = Toolkit.createImage(path);
        loadImage(image);
        return image;
    void loadImage
        MediaTracker mt = new MediaTracker(image_observer);
        mt.addImage(image, 0);
        try
            mt.waitForID(0);
        catch interrupted exception
    class extends Panel
        Image image
        public void paint(
            g.drawImage(image,
        public void update(
            paint(g);
        public Dimension getPreferedSize
            return size of image

  • How can I get file from local disk?

    hi, in my project, I store the files in server local disk, and store file name in Database. How can I get the file according to the file name in database? which means the file names in database are mapped to the file in local disk. How Can my application get the file according to the file name in DB?
    PS: file name are show on one web page as link, when user click the link, user can either open the file immediately or download to local PC.

    Hi Ashutosh
    You will have to use sapcar.zip which contains the utility Sapcar.exe utility for unzipping the files from SAP compressed files. (*.car file)
    Regards
    Gaurav
    PS: Reward points if solved

  • How to load a image from database to image item in oracle 10 g form

    I have stored some images in the Database Table with BLOB datatype. Now I need to load that image in the non database image item. Please advise. Thanks.

    You need to have a print server installed to generate the pdf. Either use BI Publisher and it's desktop development tool or use FOP/Cocoon.. Adding an image with them is a little more involved..
    Thank you,
    Tony Miller
    Webster, TX
    While it is true that technology waits for no man; stupidity will always stop to take on new passengers.

  • To load the image from appl. server to FORM

    Hi all,
    i have to fetch the image from Application server and Print in a form. i don't know how to load the image from appl. server to FORM.Through SE78 i guess we can load the image only from presentation server,,,,can anyone help on this????

    Hi Bhuvaneshwari ,
    Through <b>SE78</b> you can fetch the image from application server.
    Goto><b>Graphics</b>><b>BMAP(Bit map images)</b>>In <b>Name</b> parameter click <b>F4</b> for input help.>click on <b>execute</b> button.
    These images are stored on document server.
    There you can find images of application server.
    Those images you can import.
    Reward if helpful.
    Regards,
    Sandhya.

  • How can I best load RAW images from a Canon SX50?

    How can I best load RAW images from a Canon SX50?

    9Sorry, ........confused about this process.   When I attempted to Post the question I had entered, I was told a blank space could not be posted.  So, I reentered the Q in the "space"........ which apparently was the space for an answer....!! ??......)
    >  When I try to load RAW images taken by my Canon SX50 from the SD card, iPhoto 11 -  (iMac/OSX 10.6.8) tells me that it can't read the format or something like that.    OSX 10.6.8 came out before the SX50, thus, did not include the related program.           I want to shoot RAW on the SX50....... but I then want to load them into iPhoto....... which I do directly from pics I take with my Nikon D200.  
    Not sure if this will help.............

  • How could I to load my applet from local

    hI all,
    How can i to load my applet from local file system.
    Thanks

    Put it anywhere you want. Put the associated HTML file in the same directory as your .class file and double click on the HTML file. Your browser should open up and display your Applet.

  • How to display images on local disk(outside of WebContent of WAR) in jsp?

    In a web application, I want to display images on local disk(outside of WebContent of WAR) in jsp. I couldn't put it in "WebContent/images/" because the images are portraits of users and they could be changed dynamically. If I put images in "WebContent/images/", I have to transfer the images back and forth every time when I update my WAR file.
    Obviously, in jsp, something like
    "<img src="/home/username/images/local/PRTR.jpg" />"
    doesn't work.
    Is it durable to store the images at somewhere else like "/home/username/images/local/" in the server's local disk?

    Hi aiGrace,
    You have to transform your file path into the appropriate URL, this way :
    try {
        File file = new File("D:/Test/MyPic.jpg");
        System.out.println(file.toURI().toURL());
    } catch (MalformedURLException ex) {
        ex.printStackTrace();
    }Then, you insert the URL in your img tag.

  • Loading an image from CameraRoll - how long should it take ?

    Hi All
    I'm loading an image from the CameraRoll using this method http://www.flashandmath.com/mobile/cameraroll/
    Now on my iPad2 the image loads pretty instantaneously
    However on my iPhone4 it takes approx 8 seconds for the image to load.
    ( The time is taken after calling loader.loadFilePromise waiting for Event.COMPLETE ... i.e. the image to load )
    function onImgSelect(event:MediaEvent):void {
    var promise:MediaPromise = event.data as MediaPromise;
    removeBrowseListeners();
    loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);
    loader.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, onError);
    loader.loadFilePromise(promise);
    The code base is the same. There are (at least) 2 differences :-
    1) The hardware (iPad vs phone)
    2) The number of images on the camera roll (approx 60 on iPad vs almost 900 on the phone)
    Has anyone else noticed such a difference in speed between devices / number of files ?
    Is there a better/quicker way to load an image from CameraRoll ?
    Is 8 seconds normal/acceptable (I show a busy indicator)
    Any help / suggestions/ observations most appreciated !

    If you opted for the Secure Erase and the account has a lot of data in it, then it could take days to complete.

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

  • Error While loading a image from database

    Purpose
    Error While loading the Image from the database
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Requirement:
    I am developing the web pages using PSP(Pl/sql Serverpages) . I have a requirement to show a image in the webpage. I got the following procedures from the oracle website.
    I have created the following table to store the images
    create table DEMO
    ID INTEGER not null,
    THEBLOB BLOB
    And I also uploaded the Images. Now I am try to get a image from the table using the following procedure .But I am getting the error message line 25( htp.prn( utl_raw.cast_to_varchar2( l_raw ) );) .at it throws the following error messages
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Procedure that I used to get the image
    create or replace package body image_get
    as
    procedure gif( p_id in demo.id%type )
    is
    l_lob blob;
    l_amt number default 30;
    l_off number default 1;
    l_raw raw(4096);
    begin
    select theBlob into l_lob
    from demo
    where id = p_id;
    -- make sure to change this for your type!
    owa_util.mime_header( 'image/gif' );
    begin
    loop
    dbms_lob.read( l_lob, l_amt, l_off, l_raw );
    -- it is vital to use htp.PRN to avoid
    -- spurious line feeds getting added to your
    -- document
    htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
    l_off := l_off+l_amt;
    l_amt := 4096;
    end loop;
    exception
    when no_data_found then
    NULL;
    end;
    end;
    end;
    What I have to do to correct this problem. This demo procedure and table that I am downloaded from oracle. Some where I made a mistake. any help??
    Thanks,
    Nats

    Hi Satish,
    I have set the raw value as 3600 but still its gives the same error only. When I debug the procedure its throwing the error stack in
    SYS.htp.prn procedure of the following line of code
    if (rows_in < pack_after) then
    while ((len - loc) >= HTBUF_LEN)
    loop
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1, HTBUF_LEN);
    loc := loc + HTBUF_LEN;
    end loop;
    if (loc < len)
    then
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1);
    end if;
    return;
    end if;
    Its a system procedure. I don't no how to proceed .. I am really stucked on this....is their any other method to take picture from the database and displayed in the web page.....???? any idea..../suggesstion??
    Thanks for your help!!!.

  • JAVA, sqlserver - Need to load an image from the sql server database

    hi,
    I need to load an image from the sql server database using java. I have connected to the database and getting all other records except the records for a photo (datatype = LONGVARBINARY) and Remarks (datatype = LONGVARCHAR).
    I am using java and sql server db. The photo and remarks are stored in the db. and i need to show the image and the remarks fetching them from there.
    I get the error :
    Thread-9 org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
    How can I achieve this?
    Thanks,
    Gargi

    Exactly. And are you using MySQL?
    No. You are using Microsoft SQL server if I have to believe your initial post. A quick google tells me that the dialect class to use is:
    org.hibernate.dialect.SQLServerDialect

  • How do I remove images from aperture?

    Totally new to apple and aperture so I apologise if this seems like a somewhat noob question but how do I remove images from aperture (using the latest version, 3.4.1)? Coming from a PC and using lightroom I'm used to being able to remove images in two ways:
    - removing the image from the "library", so that it no longer shows up in the program at all but is still on your hard drive (when I say removing it from the program entirely, I mean entirely, i.e. not sitting in a trash can or some other place where it's still taking up memory)
    - deleting the original image off the hard drive
    Is it possible to do either of these things in aperture, on both just a single image or a selection of multiple images, and if so how? I've tried googling this already and am getting a bunch of mixed solutions, none of which have really worked so far, so any answers would be appreciated. Thanks!

    The answer partially depends on whether you have a managed or referenced library. Since you're totally new to Aperture, I'm assuming you have a managed library since that's the default.
    FYI: Managed means Aperture handles image files and places them inside the library file. Referenced means you manage the image files and Aperture only points to (references) them.
    For a managed library, select an image you want to delete. Type command-delete. (That's the reverse delete key next to the "=" key). (You can also right-click an image and choose Delete Version) That will remove the images from their Project and place in the Aperture Trash. They're still taking up space in the Trash. If you really want them gone for good, right-click the Trash in the library pane and select Empty Trash. Poof.
    For a reference library, I forgot the exact details since I don't use this type of library, but you'll be asked (or can check a box) to delete the original file from the disk.

  • How to upload RAW images from Nikon 600 into Elements 11?

    Hi recently purchased Elements 11 and cannot load Raw images from also recently purchased Nikon D600. Is there a download and if so where is it and how does it work?
    Many thanks in advance
    trevor

    Launch the Editor and click Help >>Updates
    Install Camera Raw v7.2
    PSE11 ships with v 7.1 and needs bringing up to date to get preliminary support for the D600

Maybe you are looking for