Saving & populating images in apex

hi
I want to save & retrieve employee photoes in database using apex. can anyone help me.
vijay

Hi Vijay,
Inside your workspace do you have sample application-> Run it->Go to Tab-> product-> Click Create Product-> Form shows input field with browse button-> Edit page to see the code to implement saving & populating images in apex.
This is table based storage inside apex.
If you want to store inside apex for your designing then go to shared component -> image-> create new image uploading-> Access from your page will be like the below.
<img src=#APP_IMAGES#temp.jpg>
This link also help.
http://download.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm
Thanks,
Loga
Edited by: Logaa on Sep 15, 2010 12:14 AM

Similar Messages

  • Help! Saving an image to stream and recreating it on client over network

    Hi,
    I have an application that uses JDK 1.1.8. I am trying to capture the UI screens of this application over network to a client (another Java app running on a PC). The client uses JDK 1.3.0. As AWT image is not serializable, I got code that converts UI screens to int[] and persist to client socket as objectoutputstream.writeObject and read the data on client side using ObjectInputStream.readObject() api. Then I am converting the int[] to an Image. Then saving the image as JPEG file using JPEG encoder codec of JDK 1.3.0.
    I found the image in black and white even though the UI screens are in color. I have the code below. I am sure JPEG encoder part is not doing that. I am missing something when recreating an image. Could be colormodel or the way I create an image on the client side. I am testing this code on a Win XP box with both server and client running on the same machine. In real scenario, the UI runs on an embedded system with pSOS with pretty limited flash space. I am giving below my code.
    I appreciate any help or pointers.
    Thanks
    Puri
         public static String getImageDataHeader(Image img, String sImageName)
             final String HEADER = "{0} {1}x{2} {3}";
             String params[] = {sImageName,
                                String.valueOf(img.getWidth(null)),
                                String.valueOf(img.getHeight(null)),
                                System.getProperty("os.name")
             return MessageFormat.format(HEADER, params);
         public static int[] convertImageToIntArray(Image img)
             if (img == null)
                 return null;
            int imgResult[] = null;
            try
                int nImgWidth = img.getWidth(null);
                int nImgHeight = img.getHeight(null);
                if (nImgWidth < 0 || nImgHeight < 0)
                    Trace.traceError("Image is not ready");
                    return null;
                Trace.traceInfo("Image size: " + nImgWidth + "x" + nImgHeight);
                imgResult = new int[nImgWidth*nImgHeight];
                PixelGrabber grabber = new PixelGrabber(img, 0, 0, nImgWidth, nImgHeight, imgResult, 0, nImgWidth);
                grabber.grabPixels();
                ColorModel model = grabber.getColorModel();
                if (null != model)
                    Trace.traceInfo("Color model is " + model);
                    int nRMask, nGMask, nBMask, nAMask;
                    nRMask = model.getRed(0xFFFFFFFF);
                    nGMask = model.getRed(0xFFFFFFFF);
                    nBMask = model.getRed(0xFFFFFFFF);
                    nAMask = model.getRed(0xFFFFFFFF);
                    Trace.traceInfo("The Red mask: " + Integer.toHexString(nRMask) + ", Green mask: " +
                                    Integer.toHexString(nGMask) + ", Blue mask: " +
                                    Integer.toHexString(nBMask) + ", Alpha mask: " +
                                    Integer.toHexString(nAMask));
                if ((grabber.getStatus() & ImageObserver.ABORT) != 0)
                    Trace.traceError("Unable to grab pixels from the image");
                    imgResult = null;
            catch(Throwable error)
                error.printStackTrace();
            return imgResult;
         public static Image convertIntArrayToImage(Component comp, int imgData[], int nWidth, int nHeight)
             if (imgData == null || imgData.length <= 0 || nWidth <= 0 || nHeight <= 0)
                 return null;
            //ColorModel cm = new DirectColorModel(32, 0xFF0000, 0xFF00, 0xFF, 0xFF000000);
            ColorModel cm = ColorModel.getRGBdefault();
            MemoryImageSource imgSource = new MemoryImageSource(nWidth, nHeight, cm, imgData, 0, nWidth);
            //MemoryImageSource imgSource = new MemoryImageSource(nWidth, nHeight, imgData, 0, nWidth);
            Image imgDummy = Toolkit.getDefaultToolkit().createImage(imgSource);
            Image imgResult = comp.createImage(nWidth, nHeight);
            Graphics gc = imgResult.getGraphics();
            if (null != gc)
                gc.drawImage(imgDummy, 0, 0, nWidth, nHeight, null);       
                gc.dispose();
                gc = null;       
             return imgResult;
         public static boolean saveImageToStream(OutputStream out, Image img, String sImageName)
             boolean bResult = true;
             try
                 ObjectOutputStream objOut = new ObjectOutputStream(out);
                int imageData[] = convertImageToIntArray(img);
                if (null != imageData)
                    // Now that our image is ready, write it to server
                    String sHeader = getImageDataHeader(img, sImageName);
                    objOut.writeObject(sHeader);
                    objOut.writeObject(imageData);
                    imageData = null;
                 else
                     bResult = false;
                objOut.flush();                
             catch(IOException error)
                 error.printStackTrace();
                 bResult = false;
             return bResult;
         public static Image readImageFromStream(InputStream in, Component comp, StringBuffer sbImageName)
             Image imgResult = null;
             try
                 ObjectInputStream objIn = new ObjectInputStream(in);
                 Object objData;
                 objData = objIn.readObject();
                 String sImageName, sSource;
                 int nWidth, nHeight;
                 if (objData instanceof String)
                     String sData = (String) objData;
                     int nIndex = sData.indexOf(' ');
                     sImageName = sData.substring(0, nIndex);
                     sData = sData.substring(nIndex+1);
                     nIndex = sData.indexOf('x');
                     nWidth = Math.atoi(sData.substring(0, nIndex));
                     sData = sData.substring(nIndex+1);
                     nIndex = sData.indexOf(' ');
                     nHeight = Math.atoi(sData.substring(0, nIndex));
                     sSource = sData.substring(nIndex+1);
                     Trace.traceInfo("Name: " + sImageName + ", Width: " + nWidth + ", Height: " + nHeight + ", Source: " + sSource);
                     objData = objIn.readObject();
                     if (objData instanceof int[])
                         int imgData[] = (int[]) objData;
                         imgResult = convertIntArrayToImage(comp, imgData, nWidth, nHeight);
                         sbImageName.setLength(0);
                         sbImageName.append(sImageName);
            catch(Exception error)
                error.printStackTrace();
             return imgResult;
         }   

    While testing more, I found that the client side is generating color UI screens if I use JDK 1.3 JVM for running the server (i.e the side that generates the img) without changing single line of code. But if I use JDK 1.1.8 JVM for the server, the client side is generating black and white versions (aka gray toned) of UI screens. So I added code to save int array that I got from PixelGrabber to a text file with 8 ints for each line in hex format. Generated these files on server side with JVM 1.1.8 and JVM 1.3. What I found is that the 1.1.8 pixel grabber is setting R,G,B components to same value where as 1.3 version is setting them to different values thus resulting in colored UI screens. I don't know why.

  • How to grey out images in APEX

    Hi,
    Can someone let me know how can I disable/greyout images in APEX?
    I have a list of images in a horizontal way, say Image 1, Image 2, Image 3, Image 4.
    So when Image 1 is accessed, Image 2,3 and 4 should be greyed out. When Image 2 is accessed, Image 3 and 4 (not Image 1) should be greyed out and so on.
    Please let me know how can this be done?

    935799 wrote:
    Hi,
    Can someone let me know how can I disable/greyout images in APEX?
    I have a list of images in a horizontal way, say Image 1, Image 2, Image 3, Image 4.
    So when Image 1 is accessed, Image 2,3 and 4 should be greyed out. When Image 2 is accessed, Image 3 and 4 (not Image 1) should be greyed out and so on.
    Please let me know how can this be done?Hi,
    What you mean by "Image is accessed"?
    Do you mean when mouse click image or hover mouse over image?
    Regards,
    Jari
    My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • How to see all image types when saving an image without selecting "all files"every time

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/951766]]</blockquote>
    Hallo, and thank you for reading this.
    I am a person who saves a lot of images online and renames them in different folders in different names like B - 34 or G - 56. I have been working with firefox 10 for quite some time and it had a pretty handy bug (I guess) where I could save an image and firefox would just save the image in it's original type (JPEG,PNG etc) while "save as type" was empty.
    It also always has shown all the image types in the folder where I save the images (except for GIF) and that helpes me quite a lot by saving me the trouble of selecting "all files" every time I save or going to the folder to rename every image.
    Now this seems to be lacking in the newest firefox versions and my question is if I can set firefox to always show me all the image file types when saving an image, instead of only showing JPEG's when I try to save a JPEG.
    Thank you for your time.

    I suspect this is a Windows problem. I am surmising the FilePicker uses the Operating System or Desktop facilities. Does Windows 7 offer any other file categories like ''images'' ?
    I do not normally use Windows 7, but may the option depend upon the directory being an indexed one, I ask after finding this thread ''Bring File types tab back'' [http://www.windows7taskforce.com/view/819]
    This question is a duplicate of [/questions/951764]
    Normally I would lock the duplicate question, but in this instance I will leave it open as it is unanswered and someone may give a better reply.

  • When saving an image in PS CS 6, and going back to Lightroom 5. The original image and the edited image are at the end of the line up.

    I'm using a Mac, Lightroom 5 and Photoshop CS 6. I've started having an issue with the line up in Lightroom 5 after saving an image from PS CS 6. For some reason when I save the edited image form CS 6 it's taking the edited image and the original image and putting it at the end of the line up in Lightroom. If I take the edited image and move it to the right of the original it will put both of them back in the line up where they should be. How do I fix this. I've been looking in the menu for some kind of setting  with no luck.

    Change the sort order. View->Sort

  • Trouble saving the image, save as button not working

    i'm having trouble in saving the image in PNG format, it seems that the "save as" button is not working properly, what should i do?

    Save from what program? On what system? In any case, ask in the product forum of whatever program you are referring to...
    Mylenium

  • File name used by plug-in for saving the image file.

    I have a program that creates a web page that has an object tag with a call to a program and that program delivers a PDF file.  When my users want to save that image the name of the image is a random name.  Is there any way to make the plug-in, Adobe, use the meta tag Title or any other infromation that my program can provide, as image (file)  name to be used for saving the image. (the initial suggested name)?  I really appreciate your help.

    One option is to rename the file after it's been exported using Windows File I/O API.

  • How do you display a image in apex

    I have a trouble for a long time..
    I can't load a image in apex..
    I do a lot of things but it never give result correctly
    some could help me..
    Thank u....

    Hi,
    OK - the link I gave will explain how to upload into a table and then display images from there.
    To do this through Shared Components:
    1 - Go to Shared Components
    2 - Select Images
    3 - Click Create
    4 - In the Application option, leave it as "No Application Associated" if you want any application to use the image, or select an application if the image is for that application only
    5 - Click the Browse button, locate your image file on your machine and click Open
    6 - Any any Notes you want (this is not required)
    7 - Click Upload
    On your page, decide where you want the image to appear. This can be in a region's Source, Region Header or Region Footer OR if you want you can do this on the page template you are using. Then enter in:
    For an image NOT associated with an application:
    &lt;img src="#WORKSPACE_IMAGES#filename.gif"&gt;For an image associated with an application:
    &lt;img src="#APP_IMAGES#filename.gif"&gt;Andy

  • Loading new xml data into a already xml populated image display

    Hi everybody,
    I have a question about loading new xml data into a already xml populated image gallery.
    So I have my gallery set up so it calls some xml when it first loads. What I would now like to do is load different sets of images via a different xml sheet via the click of a button.
    So for example the loaded gallery already has all thumbs loaded and user can click on them to view the full size image. So next instead of the user having to close this gallery to allow a new gallery to open with a different set of pictures I would just like to have a button. This button will unload the existing thumbs from the gallery and load in new ones from a different xml file.
    If anybody can help me with this it would be great as I am still on a steep learning curve with AS3.
    Here is my AS3
    var xmlPath:String = "pictures.xml";
    var xml:XML;
    var loader = new URLLoader();
    loader.load(new URLRequest(xmlPath));
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    function xmlLoaded(e:Event):void
         if ((e.target as URLLoader) != null )
              xml = new XML(loader.data);
              createMenu();
    var numberOfItems:uint = 0;
    var menuItems:Array = new Array();
    function createMenu():void
              numberOfItems = xml.items.item.length();
         var count:uint = 0;
              for each (var item:XML in xml.items.item)
              var imageLoader=new Loader();
              var menuItem:MenuItem = new MenuItem();
              menuItem.addChild(imageLoader);
              imageLoader.load(new URLRequest(item.url));
              menuItem.linkTo = item.linkTo;
              menuItem.mouseChildren = false;
              menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
              menuItems.push(menuItem);
              addChild(menuItem);
              count++;
    function ***():void
         //menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
         for (var i:uint = 0; i < menuItems.length; i++)
              setChildIndex(menuItems[i], i);

    Thanks so much for the reply Andrei1
    I think maybe my lack of knowledge when it comes to AS3 is not helping me at the moment because I thought I understood the code you supplied but there is something not going quite right.
    So I messed around with the code and added the new_loaded_thumbs_btn to load in the "new_pictures.xml" but I am def doing something wrong.
    import flash.ui.ContextMenuItem;
    var xmlPath:String = "pictures.xml";
    var xml:XML;
    var numberOfItems:uint = 0;
    var menuItems:Array = new Array();
    var loader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    loadXML("pictures.xml");
    new_loaded_thumbs_btn.addEventListener(MouseEvent.CLICK, loadXML);
    function loadXML(path:String):void {
         loader.load(new URLRequest("new_pictures.xml"));
    function loadXML(path:String):void {
         loader.load(new URLRequest(path));
    function xmlLoaded(e:Event):void
         xml = new XML(loader.data);
         createMenu();
    function createMenu():void
         clearMenu();
         numberOfItems = xml.items.item.length();
         var count:uint = 0;
         var imageLoader;
         var menuItem:MenuItem;
         for each (var item:XML in xml.items.item)
              imageLoader = Loader();
              menuItem = new MenuItem();
              menuItem.addChild(imageLoader);
              imageLoader.load(new URLRequest(item.url));
              menuItem.linkTo = item.linkTo;
              menuItem.mouseChildren = false;
              menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
              menuItems.push(menuItem);
              addChild(menuItem);
              count++;
         sortChildren();
    // removes previously placed objects
    function clearMenu():void {
         var menuItem:MenuItem;
         while (menuItems.length > 0) {
              menuItem = menuItems[0];
              removeChildAt(getChildIndex(menuItem));
              menuItem.shift();
    function sortChildren():void
         //menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
         for (var i:uint = 0; i < menuItems.length; i++)
              setChildIndex(menuItems[i], i);
    When the image display 1st loads it displays the new_pictures.xml thumbs which I thought would load through my new button when clicked.
    And there was me thinking I was getting the hang of AS3.
    Could you please point me in the right direction in what I am doing wrong,
    Thanks for your time and effort in advance

  • Saved an image as library and now all in iphoto images disappeared

    I was saving an image from email to iphoto, and somehow it was saved as my iphoto library. All of my photos are now gone, there were hundreds, and the one image I just saved is just there. Where are my photos??? Don't they get saved somewhere on my hard drive aside from being hosted iphoto. I have a MAC AIr and iPhoto '11.

    Rename it back.
    (110127)

  • Saving an image in Root folder of tomcat

    Hello,
    i have an urgent problem with saving an image in the root folder of tomcat, which I want to do without having to specify the entire path.
    I have created a class, which i use as a bean in a jsp to save an image to the tomcat root folder.
    If I use the following command, the image is saved:
    ChartUtilities.saveChartAsJPEG(new File(
    "C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/trader/images/charts/1.jpg"), chart, 550, 260);
    However, I should be doing it like this, which doesn't work and throws me an IO exception:
    ChartUtilities.saveChartAsJPEG(new File("images/charts/1.jpg"), chart, 550, 260);
    Cheers

    Didn't we have this discussion in another thread? You can't give something urgently. It's semantically anaphoricular.

  • An error occurred saving the images to the chosen file location

    I am trying to save the scans from my HP Officejet 6500.  I receive the following error message:
    An error occurred saving the images to the chosen file location.
    I have Win 7.
    I can scan and save if I choose to use the picture option but I can't use the feeder with the picture option.  It is only good if I have 1 page.

    I received this exact same message:
    an error occurred saving the images to the chosen file location.
    8,[(8,106,0)]
    I have not had the time to verify this, but I suspect the security settings on any other location you specify are not the same as those of the default.  i.e. C:\Users\%Username%\Documents\My Scans
    When I used the default location and base name the software provided, it worked.
    My guess is Microsoft and/or HP may have changed the security permissions for something in the path folders and the Scanning Software is therefore not permitted to write into the location you entered.

  • I am using adobe photoshop cs6. I am facing a problem. When i save any image as "save for web". After saving image it show cropped. An image show many parts of the image after saving the image. Please help me. Thanks in advance.

    I am using adobe photoshop cs6. I am facing a problem. When i save any image as "save for web". After saving image it show cropped. An image show many parts of the image after saving the image. Please help me. Thanks in advance.

    Just go back in photoshop and use the Slice Select tool, then just click and select the slice and hit delete - if you're not sure which one is the active slice just right click and find the one that has the Delete Slice option.
    It's possible you either added the slices by accident or if you received it from someone they just had the slices hidden. For the future, you can go to View > Show > Slices to display (or hide) slices.

  • I am using a MacPro running OS 10.6.8. When saving an image in PS CC I no longer have a thumbnail of the image in my folder , just a generic PS symbol thumbprint. What do I do to get my image thumbnail back?

    I am using a MacPro running OS 10.6.8. When saving an image in PS CC I no longer have a thumbnail of the image in my folder , just a generic PS symbol thumbprint. What do I do to get my image thumbnail back?
    Adobe Creative Cloud

    Photoshop CC needs at least OSX 10.7-10.9
    You may be able to install and run it on 10.6.8, but as I understand it the rules for generating thumbnails has changed with Apple and CC writes them to suit the required OSX.
    Photoshop CS6 will always give you image thumbnails but CC and CC 2014 have had thumbnails generated differently for the required OSX.
    You will have to upgrade to 10.7,10.8, or 10.9
    My file saving preferences are set like this:

  • When I have resized and saved an image in Photoshop (CS, version 8.0 for Mac) using image size, why is it so large when I open it in preview or another image viewer? Has it actually saved according to the size I specified?

    When I have resized and saved an image in Photoshop (CS, version 8.0 for Mac) using image size, why is it so large when I open it in preview or another image viewer? Has it actually saved according to the size I specified?

    You want to view the image at the Print Size, which represents the size that shows in the Image>Resize Dialog.
    View>Print Size
    Since screen resolution is almost always lower that the print resolution (somewhere between 72 and 96 usually), images will always look bigger on the screen, unless you view them at print size.
    (apple Retina displays have a much higher resolution than normal screens, closer to the average print size resolution)
    more info:
    Photoshop Help | Image size and resolution

Maybe you are looking for

  • Problem with flush method

    Hello, I'm new in java development, and I'm french with a student English, sorry if that I say is strange is the expressions. I have a problem with network streams and serialization. I want to establish a connection between 2 apps, on 2 different com

  • How to mainain the document status

    Hai experts, How to mainain the document status, Based on DUEDATE and Farworded to TARGET document in USER DEFINED Forms Regards Trinadh Kumar T

  • Datasource replicating in new BI 7 version?

    Dear Bwers, I have a strange situation. We have BI 7 with R/3 4.6 as backend. I activated the datasource 2LIS_13_VDITM in R/3 and replicated in BI. I see the new version of the datasource?  I deleted and again repllicated it in BI and still see it in

  • Bought a new computer.  How do I transfer PSE 8.0 to it?

    And where do I find whatever key, code, etc., to enter when I do download this version to the new computer?  Thanks

  • Dump: ASSERT condition failed - While creating followup to Package quote

    Hi, I am trying to create follow up (Service contract) document to Package Quotation. But, I am endedup with dump in Function Module saying : "ASSERT Condition Failed". And this is happening only in preproduction. In development system, it is working