Read image using PJC

Hi,
We are converting Oracle Forms from 6i to 11g. We have some forms that use read_image_file to read image. It was .bmp file and now we can only use .gif/.jpg file on web and the image is very blurry.(we use the same .gif source file for image and icon for icon buttons, the icon is very sharp)
I tried to use PJC to read the image and image is very sharp now. I am able to read the image from local drive, like c:\my_image.gif while testing from my local PC. I would like to know how to read image from application server, where put the file and what configurations needed.
Or any solutions are welcome. I am new to Java, please help.
Hedy
Edited by: Hedy on Aug 15, 2011 12:21 PM

Hello,
I totally agree with Mark. As soon as you have created a virtual directory on the Forms server, you can reach the files stored in the corresponding physical directory.
Here is some code to get the Forms HTTP server URL (assuming that you pass only the virtual directory as file argument e.g: /forms/images/my_image.jpeg)
        String s = (String)value ; // full filename
        try {
          if(s.startsWith("http:") || s.startsWith("ftp:")
          || s.startsWith("www.") || s.startsWith("file:") || s.startsWith("/forms")) {
            initialURL = s ;
            URL url = null ;
            if(s.startsWith("/forms")) {
              // getting the Forms Main class
              try{
                Method method =
                   m_handler.getClass().getMethod("getApplet", new Class[0]);
                Object applet = method.invoke(m_handler, new Object[0]);
                if (applet instanceof Main) {
                   formsMain     =  (Main)applet;
                   String sDocBase = formsMain.getDocumentBase().toString();
                   int i = sDocBase.indexOf("/forms/") ;
                   sDocBase = sDocBase.substring(0,i);
                   initialURL = sDocBase + s;
              }catch(Exception ex) {System.err.println(" !!! ReadImage() Unable read the image\n\t"+ex.toString());}
            url = new URL(initialURL);
            // get the image there
        } catch(Exception ex) {
          System.out.println(" !!! ReadImage() Unable to read the image " + s + ": " + ex);
        } Francois

Similar Messages

  • Hey need help reading images using java bean

    Hey everyone,
    I will like to read some images from a directory using Java and display it on a JSP page, how do I accomplish this,
    thanks
    KT

    What happen is, I have to display 52 card depending on string concatenation, I have a java file that takes two elements from an array, depending on the two strings concatenation I want to display an image on a jsp page, any ideas on how to accomplish this?

  • Read image from excelsheet using labview

    i need to know how to read image from excel sheet using Labview...m not able to get the appropriate property to display the image stored in excel sheet.
    thank you

    you need to ask Microsoft to find out the property name/location under Microsoft Excel. 

  • Reading colour image using raster object and getsample() method

    Hello all,
    I am trying to read a grey image using this code below and it perfectly works:
    File filename = new File("myimage.jpg");
    BufferedImage inputimage = ImageIO.read(filename);
    Raster input = inputimage.getRaster();
    double pixelvalue = input.getSample(xx, yy, 0) ; // to read pixel colour.
    Now:
    what modifications should i do to read a colour image using getsample() method.
    any help, by example if y would.
    Thanks

    The code below
    double pixelvalue = input.getSample(xx, yy, 0) ; // to read pixel colour.actually doesn't obtain the pixel color. It reads a band of the specified pixel. If you are reading a tripple band image (24-bit colored image RGB ) then you have to invoke this method three times for band 0, 1 and 2. The arrangment of them depends on the BufferedImage type.
    In reply of your question, you can use getSamples method, refer to the java API documentation of the BufferedImage class for more info.
    you can also check methods getRGB and setRGB, they used to get/set the entire pixel in range of 0x00000000 to 0x00FFFFFF ( 0x00RRGGBB of image type TYPE_INT_RGB )
    Regards,
    Mohammed M Saleem

  • Problems reading BMP images using ReadImage function

    I am trying to load BMP images using the IMAQ Vision ReadImage function (VB6). The images load as monochrome images.
    I use the CWIMAQViewer1.Pallette as a parameter in the command.
    Note: The images load fine when using Vision Assistant or other image viewing software.
    Any ideas?
    Thanks!

    Sorry. Wrong forum. I'll repost on Machine Vision forum.

  • Webutil Read Image Problem

    Hi,
    I am reading image from client system using the below code
    CLIENT_IMAGE.READ_IMAGE_FILE(v_rd_file_name, 'JPG', 'CTRL_BLK.ADD_IMAGE');
    But this image is not displaying in the image item, this is happening for some particular images only. While writing this image into image server image size also increasing.
    We are trying one image that dimension is 2900 X 4700 this is not uploading to image item.
    but i am able to upload less than 2000 X 2000 dimension to the same image item
    below is Image item property
    Image Format : TIFF
    Image Depth : Original
    Display Quality : Medium or High
    Sizing Style : Adjust
    Any idea on thie problem...
    Regards,
    Suresh.V

    hi
    What about Java Bean????
    try the following link i hope it will help u.
    http://forms.pjc.bean.over-blog.com/article-7109292.html
    and also u may use Irfan viewer to resize the image.Did u try to use Crop?
    sasrah

  • Can't read image file

    Dears,
    I was having forms version 10.1.2.0.2 and I was using webutil to upload an image and to download it. My problem is sometimes the image files are uploaded and sometimes not => I got "Can't read image file D:\...\image.jpg"
    I upgraded to forms 10.1.2.3 and the problem persists.
    I'm seeing that the picture resides in the workspace environment and not uploaded to the database.
    I'm not limiting the size of the pic in the frmweb.cfg file, instead this limitation occurs on form level.
    Hint. If you save this picture in "photoshop" tool, than you can upload the same picture without any problem.
    Any suggested help will be appreciated.
    Best Regards,
    Joe Farah
    Edited by: Joe Farah on Feb 26, 2009 11:01 AM

    Yes dear, this is the way that we can follow in order to get rid of this problem. Actually we have to mention to all users of my system to save the image file in this tool. But, it's somehow cumbersome for them as they might not have any of the mentioned imaging tool on their systems, isn't it ?
    But isn't there any way to fix this problem ? Or shall I go by using PJC/Java Beans ? We have to find an effective way.. :)
    Thanks,
    Joe

  • I am trying to softproof an image using a CMYK .icc file. I sent an image from LR 5 to PS CC 2014, opened the Camera Raw FIlter, but the hyperlink to access workflow is not showing up in the CR dialogue box... Any ideas why this might be?

    I am trying to softproof an image using a CMYK .icc file. I sent an image from LR 5 to PS CC 2014, opened the Camera Raw FIlter, but the hyperlink to access workflow is not showing up in the CR dialogue box... Any ideas why this might be?

    I am trying to softproof an image using a CMYK .icc file. I sent an image from LR 5 to PS CC 2014, opened the Camera Raw FIlter, but the hyperlink to access workflow is not showing up in the CR dialogue box... Any ideas why this might be?

  • Capture an image using the web camera from a web application

    Hi All,
    Could anyone please share the steps what have to be followed for capture an image using the web camera from a web application.
    I have a similar requirement like this,
    1) Detect the Webcam on the users machine from the web application.(To be more clear when the user clicks on 'Add Photo' tool from the web application)
    2) When the user confirms to save, save the Image in users machine at some temporary location with some unique file name.
    3) Upload the Image to the server from the temporary location.
    Please share the details like, what can be used and how it can be used etc...
    Thanks,
    Suman

    1) Detect the Webcam on the users machine from the web application.(To be more clear when the user clicks on 'Add Photo' tool from the web application)There's not really any good way to do this with JMF. You'd have to somehow create a JMF web-start application that will install the native JMF binaries, and then kick off the capture device scanning code from the application, and then scan through the list of devices found to get the MediaLocator of the web cam.
    2) When the user confirms to save, save the Image in users machine at some temporary location with some unique file name.You'd probably be displaying a "preview" window and then you'd just want to capture the image. There are a handful of ways you could capture the image, but it really depends on your situation.
    3) Upload the Image to the server from the temporary location.You can find out how to do this on google.
    All things told, this application is probably more suited to be a FMJ (Freedom for Media in Java) application than a JMF application. JMF relies on native code to capture from the web cams, whereas FMJ does not.
    Alternately, you might want to look into Adobe Flex for this particular application.

  • Downloading images used to go automatically to the last folder used to save images, even when reopening Firefox. In just the past few days, possibly coinciding wih the most recent updates, the folder defaults to the 'Downloads' folder. This is most annoyi

    Downloading images used to go automatically to the last folder used to save images, even when reopening Firefox. In just the past few days, possibly coinciding wih the most recent updates, the folder defaults to the 'Downloads' folder. This is most annoying. What happened? Internet Explorer 8.0 did the same thing. This was one of the reasons why I started using Firefox to download all images. I went into Tools>Options and it only lets me set another folder. I dont want to set a specific folder I want it to always go to the last folder used. So what gives?
    == This happened ==
    Every time Firefox opened
    == possibly when the most recent updates were installed, a few days ago

    Thanks jscher 2000. I guess I didn't make it clear. "It restarts with all the addons activated, and resumes with the tabs that were open before closing it." IE, it's running fine now with all the extensions activated. Everything is OK now.
    So something in the Firefox code was causing the bad behavior. It's not essential that I find out what the problem was - I'm just curious. And if anybody else has this same problem, it might be nice to have it corrected at the source.

  • Create a new Buffered Image using Raster and ColorModel

    Sorry , I crosspost this message,because no one reply.
    Recently,I write a programme combining C++ and Java .
    The C++ part create a array containing image data in form of BI_RGB and biBitCount==32.
    The java part create a image using Raster and ColorModel like this:
       static int[] data ;
       DataBuffer db = new DataBufferInt(data, data.length);
       WritableRaster wr =Raster.createPackedRaster(db, 1024,768, 32, null);
       ColorModel cm = new DirectColorModel(32,0xff0000,0x00ff00,0x0000ff);
       img = new BufferedImage(cm, wr, false, null);But it doesn't work .
    it report this:
    Exception in thread "main" java.lang.IllegalArgumentException: Raster sun.awt.im
    age.SunWritableRaster@dff3a2 is incompatible with ColorModel DirectColorModel: r
    mask=ff0000 gmask=ff00 bmask=ff amask=0
    at java.awt.image.BufferedImage.<init>(BufferedImage.java:549)
    at monitor.test.Perform2.main(Perform2.java:39)

    hey epico
    compiles & runs 4 me
    see javadocs for SinglePixelPackedSampleModel
    import java.awt.image.*;
    public class Tester {
    DataBuffer db;
    WritableRaster wr;
    ColorModel cm;
    BufferedImage im;
    int[] data;
    int[] masks;
    int w = 768;
    int h = 576;
      public Tester() {
        data = new int[768*576];
        for (int i = 0;i < w*h ;i++ ) {
          data[i] = 0;
        masks = new int[3];
        masks[0] = 0xff0000;
        masks[1] = 0x00ff00;
        masks[2] = 0x0000ff;
        db = new DataBufferInt(data,data.length);
        SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT,w,h,masks);
        cm = new DirectColorModel(32,0xff0000,0x00ff00,0x0000ff);
        wr = Raster.createWritableRaster(sm,db,null);
        im = new BufferedImage(cm,wr,false,null);
      public static void main(String[] args) {
        Tester tester1 = new Tester();
    }

  • Problem in creating 1 image using differnt images

    Dear Fellows I want to create an image by using different images in byte array format. Images may be transparent or normal images. I want final result in byte array. I am using the following technique which is working fine but the problem with this technique is that it takes too much time to create an image. This is because I am using MediaTraker. If I delete the code of MediaTracker then program have undeterministic behavior i.e, sometimes it create the final image properly and sometimes nothing is displayed in final image.
    I need some help from you. If anyone of you know the technique to draw image using different images without using mediaTracker kindly let me know.
    Early replies will be appreciated
    // here is the sample code which i m using for creating image
    byte[] backgroundImage= // read 800 X 600 image from disk and convert it in to byte array
    byte[] image1 = // read 200 X 200 image from disk and convert it in to byte array
    byte[] transparentImage // read 300 X 300 transparent image from disk and convert it in to byte array
    Image img=null;
    Frame frame =new Frame();
    frame.addNotify();
    //creating BufferedImage object to store Final image
    BufferedImage requiredImage= new BufferedImage(800,600,BufferedImage.SCALE_SMOOTH);
    //get Graphics of BufferedImage created above
    Graphics2D g=(Graphics2D) requiredImage.getGraphics();
    ///// begin draw back ground image
    img=Toolkit.getDefaultToolkit().createImage(backgroundImage);
    try
    MediaTracker mt = new MediaTracker(frame);
    mt.addImage(img, 0); // adds image with ID 0
    mt.waitForID(0);
    }catch(Exception myex)
    myex.printStackTrace();
    //draw background starting from x=0, y=0 with 800 X 600 dimentions
    g.drawImage(img,0,0,800,600,null);
    ////////// end draw background image
    ////////// begin draw image1
    img=Toolkit.getDefaultToolkit().createImage(image1);
    try
    MediaTracker mt = new MediaTracker(frame);
    mt.addImage(img, 0); // adds image with ID 0
    mt.waitForID(0);
    }catch(Exception myex)
    myex.printStackTrace();
    //draw image1 starting from x=10, y=10 with 200 X 200 dimentions
    g.drawImage(img,10,10,200,200,null);
    //////////// end draw image1
    //////begin transparentImage
    img=Toolkit.getDefaultToolkit().createImage(backData);
    try
    MediaTracker mt = new MediaTracker(frame);
    mt.addImage(img, 0); // adds image with ID 0
    mt.waitForID(0);
    }catch(Exception myex)
    myex.printStackTrace();
    //draw transparentImage starting from x=400, y=0 with 300 X 300 dimentions
    g.drawImage(img,400,0,300,300,null);
    ///end draw transparent image
    byte []finalResult = //convert requiredImage into byte array;
    you can mail me the solution on my email address [email protected]
    thanks with best regards
    and waiting for someone to reply
    kamran zameer

    is there anyone on this forum to help me??????
    regards,
    kamran zameer

  • Problem in creating client side PDF with image using flex and AlivePD

    I need a favor I am creating client side PDF with image using flex and AlivePDF for a web based application. Images have been generated on that pdf but it is creating problem for large size images as half of the image disappeared from that pdf.I am taking the image inside a canvas . How do i control my images so that they come fit on that pdf file for any image size that i take.
    Thanks in advance
    Atishay

    I am having a similar and more serious problem. It takes a
    long time to execute, but even attaching a small image balloons the
    pdf to 6MB plus. After a few images it gets up to 20MB. These are
    100k jpeg files being attached. The resulting PDF is too large to
    email or process effectively. Does anyone know how to reduce
    size/processing?

  • I have installed a trial of Adobe illustrator on my macbook pro. I want to trace an image using the custom trace button but can't. Does anyone have any ideas how I could custom trace?

    I have installed a trial of Adobe illustrator on my macbook pro. It is the 2014 release of adobe illustrator. I want to trace an image using the custom trace button.
    I start a new document. Then I place my scanned pencil/colored pencil drawing, in to the document. I have tried scanning and then placing it as a jpeg, bitmap, and tiff file. I have tried scanning and then placing it, in color and in black and white. The scan mode I use is flatbed. Adobe illustrator allows me to select the default button and one of eleven preset buttons (e.g high fidelity photo), but it does not allow me to click the custom trace button. The custom trace button is grey while all the other buttons are white.
    Does anyone have any ideas how I could custom trace?

    It seems pointless to adjust it afterwards because it is then only a couple a pencil lines rather then a full drawing. And how do I adjust it afterwards? Would I do this using the different buttons under the window button?

  • How to print uspto patent images using Safari and Quicktime

    3/18/06
    Do you want to know how to print US patent images using Safari? Read on.
    When you access the "images" link of a specific patent on the www.uspto.gov/ website using Safari, the page you are viewing is only one small upper left tile of a huge patent image that is not sized to the screen. You can scroll and try to read the page but it's almost impossible. Try to print it out and you only print what's on the screen. Bummer.
    The fix:
    Place the cursor on the opened image (it may appear blank), hold down the CONTROL key on you keyboard and click on the image. Two instructions come up. Click on the "Save Image to the Desktop" instruction and a DImg.tiff file will be created on your desktop. Click on the .tiff file and it should open in the Preview program, then simply print out the image. Voila!!!!
    Click the yellow arrow in the left margin to access page 2 of the patent and repeat the previous instructions to create another .tiff file on your destop. Do every page and you'll have the patent available to print out one page at a time.
    You can then rename the files and create a folder for that specific patent so you can access it later without signing onto uspto site.
    It's odd that the ever compatible Apple does not provide seamless compatibility to view and print patent images on the US Patent and Trademark Office's website. Where would they be without protecting their own intellectal property? Let's hope the next version of Quicktime includes the appropriate ITU T.6 or CCITT Group 4 (G4) compression language.
    Even the "throw it out the Windows" operating system is up to speed on this issue for America's hard working inventors.
    Keep on inventing.
    Tommy K
    imac 400 DV   Mac OS X (10.3.9)   Cube 450
    imac 400 DV   Mac OS X (10.3.9)   Cube 450

    Another similar thread on this issue...
    http://discussions.apple.com/thread.jspa?messageID=1602391

Maybe you are looking for

  • My HP F4180 not working with my Mac Mini

    My HP F4180 will not work with my Mac mini. I doesn't even like my set up disc. Please advise. Thank You.

  • In ODI where we maintain the folders for a file system

    Hi all For file system,I have to maintain different type of folders in Dev server.for example Input,Process,Error,Log,etc..Where we going to maintain these folders in the devlopment server? Can you be clear about the File system is maintained in the

  • Order combination in IS MILL

    Dear support, I will explain my business scenario. My client wants to convert the planned order in to partial production Order then he wants to combine with another production order through the Order Combination concept(IS MILL) For ex Sales order no

  • Meaning of Inspection lot status

    Dear all guru, when we make any GR for a material which is applicable for quality inspection , SAP automatically creates a lot for the same and updates the status as CRTD CHCR SPR and go on updating as lot get undergo the quality inspetion stages, so

  • External Drive Doesn't Show Up When Booting

    I have an iMac (intel) 10.5.8, and I want to reset my Macintosh HD and I found I could do it using disk utility when booting from another source. Unfortunatly I don't have the installation disc (I bought the mac 2nd hand) so I tried backing up my com