How do I display Canvas Graphic image (Not Iconic button) from jar file

Hi all,
I am currently using Forms 10g.
I have gone through the tutorials on how to add Button Icons into Jar files for web enables forms .....so far so good
This however does not explain what I actually want to do... since "graphic images are by nature embeded in the for rather than referenced ......so here goes ..
I have a forms 10g application where all the individual form modules/canvases display a big banner (covering top 20% of the screen). This was done by importing the image straight unto the content canvases. As you know this now becomes a "graphic Image" now embeded(& not referenced by file name) on the canvas. Also bear in mind that this is actually different from an "Image Item" which is a block object.
I dont know if this is possible, but what steps do i follow to make the image part of a jar file as opposed to my current situation. Please let me know if possible or not so I stop waisting development time looking for answers :)
Another question is how do i make this jar file a library object so that we can vary the image as we wish
NB: one other trick which i can think of is to create a giant push button across the screen to display the image and then stick it in a jar file !
Cheers
css_jay99

I don't know about embedded images imported in from the builder, but there is a way to use READ_IMAGE_FILE into a BLOCK.IMAGE_ITEM where the images are all in a jar file stored on the OAS.
Metalink Note:137397.1 explains it in details.
Tony

Similar Messages

  • Storing images and icons in a JAR file

    Hi,
    I current have a JAR file to store our application icons in the GIF format. The application also uses several images which I would prefer to be stored in the JAR file as JPG files.
    Is it possible to store both GIFs and JPGs in a JAR and access them from Forms?
    For Example:
    I am using code like:
    read_image_file('mess_bold.jpg','URL','IM_BOLD');
    and I have this image file in the JAR but I get the error...
    Unable to load image mess_bold.jpg for Image Item
    Also the Apache log shows...
    File does not exist: c:/oracle/frhome_1/forms/java/icons/mess_bold.jpg.gif
    Is this a config problem? I noticed that the read_image_file call looks in the icons directory which I specify in my Registry.dat file. Do the settings for default.icons.iconpath and default.icons.iconextension apply to images as well?
    Thank you in anticipation.
    Regards,
    Tom Casserly

    Hi,
    I already had the entry imageBase=codebase in my formsweb.cfg
    According to this article it is possible to read images from the JAR using the 'URL' parameter see
    https://metalink.oracle.com/metalink/plsql/f?p=130:14:2109110130595761322::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,137397.1,1,1,1,helvetica
    I have managed to get the images loading from the JAR but only if I have them in the same directory and format (ie gif) as the icons. As I suggested above I think that read_image_file must be accessing the default.icons.iconpath=icons/ default.icons.iconextension=gif from my Registry.dat file.
    There is also a slight problem that you cannot seem to use read_image_file in the WNFI or PF trigger as suggested here: Re: Read images from a jar file?
    Has anyone managed to access images from a JAR in JPEG format alongside GIF icons?
    Thanks for you help.
    Regards,
    Tom Casserly

  • How do you display a new image in  webdynpro view?

    How do you display a new image in  webdynpro view?
    Where is the image stored and how do we specify the image path?

    hi ,
    The UI element Image enables you to integrate graphics into the Web application in a format that is processed by the Web Server u2013 for example, GIF, JPG, and PNG format. Height and width of the graphic can be specified using the properties height and width. The graphic is displayed without borders.
    saveur image   as mime
    with Mime Objects u cn upload doc , jpeg, or giff files from our local system into the webdypnpro system .
    Right click on ur component->mime object->import
    In the transaction sicf/bc/webdynpro , u cn check your component name there you can view the mime objects created by you .
    also refer the SAP online help :
    http://help.sap.com/saphelp_crm50/helpdata/en/46/bb182fab4811d4968100a0c94260a5/content.htm
    to knw more abt mime repositories.
    http://help.sap.com/saphelp_nw04/helpdata/en/f3/1a61a9dc7f2e4199458e964e76b4ba/content.htm
    regards,
    amit

  • How we can display two list if not using blocked alv ,not scr painter

    how we can display two list if not using blocked alv ,not scr painter

    1. Once the cell number/service on the 3GS is transfered to the 5, the 3S will become basically an iPod touch until a new sim is in place, correct? We can still use wi-fi and the apps on the phone, and still be able to sync to iTunes, correct? iOS has been upgraded to 6.
    1a. With a new Sim, any issue with losing any data/apps on the phone? I dont' think so.
    1. Yes. without a sim it has no service, but all other features should be useable normally.
    1.a Nope, Data and Apps are independent of the Sim.
    2. Once the 5 is activated on the new carrier, how do I share the apps within iTunes? Is it as easy as using iCloud (which we haven't "activated" yet) and/or plugging both phones into iTunes and transferring between devices (authorizing both)? Photos? There are photos on the 3S that we will need on the 5.
    2. As long as both Phones use the same Apple ID, the applications can be synced to each through iTunes. Also any downloads on one phone should appear in the other. Again as long as both phones are using the same Apple ID.
    3. Reverse order for new apps purchased (understand that not all the iphone 5 apps will work on the 3GS)?
    3. If they can be run on the iPhone3GS they should be synced automatically.
    4. My husband also has a new iPad, any complications there with three devices? To date, he has not "shared" apps between his 3S and the iPad. He does not have iCloud set up, but plugs into his computer to backup and transfer photos. 
    4. If all 3 Devices share the same Apple ID all should be synced. 
    As a word of warning, if all 3 devices use the same Apple ID, messages recieved using iMessage will appear on all 3 devices.
    And Conctacts may get overwritten if synced to iCloud (thogh you say he doesn't have one), or merged together.

  • How can I display de last items of a region from other page in Portal?

    I want to display de last five items (f.e.) included in a region (with attributes created) from other page. I've tried using custom search, but it also shows the attribute names, and I want show the attribute values (I don´t know how can I format these attributes).
    Thanks a lot.

    How can I display the last items of a region from other Oracle Portal page?

  • In Keynote09, if i set custom presenter display settings (large presenter notes), and i save the file, will i see my notes in the same way on another computer? Are the presenter display setting saved in the file?

    In Keynote09, if i set custom presenter display settings (large presenter notes), and i save the file, will i see my notes in the same way on another computer?
    Are the presenter display setting saved in the file?
    Thanks for your help!

    it wont.
    Presenter note display is set per machine.
    Surprising nobody in this community knew this.

  • Data driven graphics - output not in layer order(with files added)

    Hi All
    I am using CS3 Fireworks, making numbers on small icon button with different text and graphics.
    xml table is prepared.
    I made a Fireworks template file with text/image variables in single layer, order as below:
    Top
    Text var.(button name)
    image var.(icon graphic)
    image var.(button background graphic)
    then run the wizard and the output becomes:
    Top
    image var.(button background  graphic)
    Text var.(button name)
    image var.(icon graphic)
    The swop image include auto shape vector graphics, bitmap(PNG),
    I tried using vectors with live filter but doesn't work, so flattened to bitmap(PNG)
    is there any method to keep the output as preferred orders? Please help.

    It seems as if the output has an ASCII order. Perhaps a prefix on the template layers will help.

  • How do I make a panorama image in Elements 11 from 5 separate photos?

    How do I make a panorama image in Elements 11 from 5 seperate photos

    You can browse your files directly from Photomerge dialog box also. Here is the descriptive help link to guide you on how to create your perfect dreamy panorama http://helpx.adobe.com/photoshop-elements/using/stitching-together-panoramas.html

  • How do I read the images I bundled into the jar file?

    I just wrote an applet that uses
         Toolkit tk = Toolkit.getDefaultToolkit();
         tk.getImage("blah.gif");to load a bunch of image files. The class file and gif images were bundled into a jar file to minimize the number of connections the browser has to make to the server.
    The applet works fine in appletviewer but trips a java.security.AccessControlException: access denied (java.io.FilePermission select.gif read) when run in a browser. I know you normally use Applet.getImage(URL) to load images but wont that circumvent the JAR file and make a seperate connection to the server for each image? That would defeat the purpose of using a JAR file.
    How do I access the image files I bundled into the JAR file?

    From your Applet class, write the following:
    URL imgUrl = getClass().getResource("blah.gif");
    Image img = getImage(imgUrl);The returned URL will be from the Applet class ClassLoader, which will look into the specified archive (jar) file.

  • How to get resources from jar-files

    Hi
    in my app I load an image via the Toolkit.getImage() method.
    Works fine if the app and the image are in folders on disk.
    It fails to load the image, if the app (and the image) is packed in a jar file.
    How can I get the image from there?
    I try to get the image as follows:
    String s = getClass().getResource("MyApp.class").getFile();
    AppPath = s.substring(0,s.lastIndexOf("/"));
    String PathToImages = "/images";
    MyImage = (Image)Toolkit.getDefaultToolkit().getImage(AppPath+PathToImages+"/logo32.gif");The App starts and works, it just fails to load the images.
    Any solutions??
    thanx in advance
    Herby

    This is actually pretty easy. First a little background.
    A Jar file is just a Zip file, with a few constructs for Java.
    The getResource() method is used to create a mapping to data within the Jar file, but is actually not necessary after you know how the mapping works.
    Just to give you an example of getResource:
    // returned is a url to the resource you want from your Jar file.
    URL myURL = MyClass.class.getResource("images/myimgage.gif");
    // then you can use this URL to load the resource
    Image img = getImage(myURL);If you were you look at the value of myURL you would see something similar to the followiing.
    jar:http://www.mywebsite.com/mydir/myjarfile.jar!/images/myimage.gifJust to break it down for you.
    The line always starts with the word jar:
    Followed by the path to your jar file.
    A sepearator !/
    Then the file you are loading from the Jar file.
    jar:     path_to_jar_file     !/     path_to_resource_in_jar_fileSo if you'd like, you could just create a URL object, and define the path to the object using the above method rather than using getResource.
    Anyway, back to your code. What I would do is print out what you get for:AppPath+PathToImages+"/logo32.gif"I'm thinking you might be getting 2 "/" in your path because I think:AppPath = s.substring(0,s.lastIndexOf("/"));will leave the "/" at the end and the next line you add the "/" in front of the image directory name. So you my have the following for your image path.mypath//images

  • How to call this out by clicking button from other file??

    The following coding is easy and workable...!! i wonder how do i call this out by clicking button from other file... please help!!
    import java.awt.geom.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.print.PrinterJob;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.print.*;
    public class Receipt extends JPanel implements Printable, ActionListener {
    final static Color bg = Color.white;
    final static Color fg = Color.black;
    final static Color red = Color.red;
    final static Color white = Color.white;
    final static BasicStroke stroke = new BasicStroke(2.0f);
    final static BasicStroke wideStroke = new BasicStroke(8.0f);
    final static float dash1[] = {10.0f};
    final static BasicStroke dashed = new BasicStroke(1.0f,
    BasicStroke.CAP_BUTT,
    BasicStroke.JOIN_MITER,
    10.0f, dash1, 0.0f);
    final static JButton button = new JButton("Print");
    public Receipt() {
         setBackground(bg);
    button.addActionListener(this);
    public void actionPerformed(ActionEvent e) {
    if (e.getSource() instanceof JButton) {  
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if (printJob.printDialog()) {
    try {
    printJob.print();
    catch (Exception ex) {
    ex.printStackTrace();
    public void paintComponent(Graphics g) {
         super.paintComponent(g);
         Graphics2D g2 = (Graphics2D) g;
         drawShapes(g2);
    public void drawShapes(Graphics2D g2){
    g2.drawString("Hello world",50,50);
    public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
    if (pi >= 1) {
    return Printable.NO_SUCH_PAGE;
         drawShapes((Graphics2D) g);
    return Printable.PAGE_EXISTS;
    public static void main(String s[]){
         JFrame f = new JFrame();
         JPanel panel = new JPanel();
         panel.add(button);
         f.getContentPane().add(BorderLayout.SOUTH, panel);
         f.getContentPane().add(BorderLayout.CENTER, new Receipt());
         f.setSize(580, 500);
         f.show();

    The following coding is easy and workable...!! i wonder how do i call
    this out by clicking button from other file... please help!!Copy the code from your main() method and put it into the actionPerformed() method of the other class. If you do not need to reference the instance of Receipt from the othe class, it is that easy.

  • Images in webforms from jar file

    In a headstart generated forms (designer 6 headstart 5.0.3) i have a lot of image items
    (unbound items with the hint <IM>my_image.gif</IM>
    It's a WebForms application.
    I use jar archive file for images. But i see no any image in runtime.
    The problem is: in qms$block.init_image_item (qmslib50.pll) is call to read_image_file whit 3 parameters
    image_name => 'my_image.gif'
    image_type => 'GIF' = substr(l_image_file,instr(l_image_file,'.')+1);
    item_name => 'block.my_image_item'
    It works on the web too but only if images are in the file system.
    If images are in the jar file it don't works.
    image_type for the web have to be 'URL' and
    image_name my_image (without gif)
    What i have to do?
    How can i generate form with image_name (without extension) and image_type='URL'?
    If it's impossible may be do you have a version of qms$block.init_image_item (for web :-) )
    or do i have to change this procedure myself?
    Kind regards,
    Roman Farber
    null

    procedure init_image_item
    is
    -- purpose: If the hint text contains the name of an image file,
    -- enclosed between <IM> and </IM> tags, the image file is
    -- is applied to the next item (which is the image item).
    -- Procedure is customized for web.
    -- Procedure will first looking for an image in archive jar file.
    -- If image is not found in jar file we are going to looking for
    -- an image in the file syatem.
    l_image_file varchar2(50);
    l_image_item varchar2(100);
    l_image_type varchar2(10);
    l_path varchar2(300);
    l_path_specified boolean := false;
    -- Only for web
    l_image_name varchar2(50);
    begin
    l_image_file := qms$item.get_tagged_hint_info(l_cur_item,'<IM>','</IM>');
    if l_image_file is null
    then
    return;
    end if;
    -- image file may be stored in forms parameter or global.
    -- In both cases the image file should start with a colon
    if instr(l_image_file,':') = 1
    then
    l_image_file := name_in(substr(l_image_file,2));
    end if;
    l_image_item := l_cur_block&#0124; &#0124;'.'&#0124; &#0124;get_item_property(l_cur_item_id,nextitem);
    -- check if the next item is really an image item
    if get_item_property(l_image_item,item_type) <> 'IMAGE'
    then
    return;
    end if;
    -----====================================================
    -- For Web Forms, Looking for the image in jar archive file
    -- if file is not found (or it's not the application archive jar file )
    -- then go to the file system.
    SYNCHRONIZE;
    -- Name of image without extension.
    l_image_name := substr(l_image_file,1,instr(l_image_file,'.')-1);
    -- message('l_image_name = '&#0124; &#0124;l_image_name);pause;
    -- Suppress error FRM-47109, cannot locate image file
    -- We need to suppress this message because the image files
    -- might be located in one of the FORMS50_PATH directories
    qms$forms_errors.add_suppress_message('FRM-47109');
    read_image_file(l_image_name,'URL',l_image_item);
    SYNCHRONIZE;
    if not form_success
    then
    -- message('form not succes');pause;
    qms$errors.show_debug_info('Image '&#0124; &#0124;l_image_file&#0124; &#0124;
    ': not found in jar archive file now looking for in file system' );
    qms$forms_errors.delete_suppress_message('FRM-47109');
    else
    -- message('form wel succes');pause;
    qms$forms_errors.delete_suppress_message('FRM-47109');
    return;
    end if;
    -- End of looking for the image in jar archive file
    -----====================================================
    -- file system
    l_image_type := substr(l_image_file,instr(l_image_file,'.')+1);
    Tool_env.getvar('HEADSTART\IMAGEFILE_PATH', l_path);
    if l_path is not null
    then
    if get_application_property(operating_system) like 'MSWINDOWS%'
    or get_application_property(operating_system) = 'WIN32COMMON'
    then
    if l_path not like ('%\')
    then
    l_path := l_path&#0124; &#0124;'\';
    end if;
    end if;
    -- Suppress error FRM-47109, cannot locate image file
    -- We need to suppress this message because the image files
    -- might be located in one of the FORMS50_PATH directories
    qms$forms_errors.add_suppress_message('FRM-47109');
    read_image_file(l_path&#0124; &#0124;l_image_file,l_image_type,l_image_item);
    if not form_success
    then
    qms$errors.show_debug_info('Image '&#0124; &#0124;l_image_file&#0124; &#0124;': not found on path '&#0124; &#0124;l_path
    &#0124; &#0124;', now looking in FORM50_PATH directories' );
    qms$forms_errors.delete_suppress_message('FRM-47109');
    -- Try to read the image file again, without the path name
    -- Forms will automatically search through all directories in the FORMS50_PATH
    read_image_file(l_image_file,l_image_type,l_image_item);
    qms$errors.show_debug_info('Item '&#0124; &#0124;l_image_item&#0124; &#0124;': read image '&#0124; &#0124;l_image_file);
    else
    qms$forms_errors.delete_suppress_message('FRM-47109');
    qms$errors.show_debug_info('Item '&#0124; &#0124;l_image_item&#0124; &#0124;': read image '&#0124; &#0124;l_path&#0124; &#0124;l_image_file);
    end if;
    else
    read_image_file(l_image_file,l_image_type,l imageitem);
    qms$errors.show_debug_info('Item '&#0124; &#0124;l_image_item&#0124; &#0124;': read image '&#0124; &#0124;l_image_file);
    end if;
    exception
    when form_trigger_failure then raise;
    when others then qms$errors.unhandled_exception('qms$block.init_image_item');
    end init_image_item;

  • How to make iTunes read the song's name/singer from the file's name itself?

    Hi everyone,
    So I have this file with songs from everywhere. I spent quite some time now to make sure that the structure of each file's name is as such : "Singer - Song name", hoping that everything would be read by iTunes accordingly. However, either iTunes read it well, or it didn't read it at all ("Singer - Song name" appearing in Title alone), or iTunes read the "media" of the file (ie. what the guy I downloaded it from wrote for it in the Preferences, which usually is in capital letters or with a bunch of weird underscores). As I'm OCD and need everything to be neat, I'm highly tensed right now. I really want everything to be neat and clear!
    So, how do I make sure that iTunes reads the files' names such that it knows the structure is "Singer - Song name"? Thanks.

    iTunes doesn't use file names to determine how music appears in your library,  Rather, it uses metadata that is split between:
    data elements that are embedded within the media files
    data elements that are included in the entries in the iTunes database
    No amount of reorganization, renaming or other manipulation at the file level will make any difference to how songs will appear in iTunes.  Using your example:
    the value of the track number element is 1
    the value of the artist element is "Elvis Presley"
    the value of the song name element is "Blue Suede Shoes"
    Depending on how you configure iTunes then the file name is either:
    completely independent of iTunes (i.,e., the file containing this song could be xyz.mp3)
    dependent on the metadata managed by iTunes, (i.e., when you have these two options set:
    then iTunes will set the file name to be 1-01 Blue Suede Shoes.mp3 where:
    the file is in a folder called "Elvis Presley" (the name of the album)
    that folder is in one called "Elvis Presley" (the name of the artist) which is in iTunes Media\Music
    Going back to your question "How to make iTunes read the song's name/singer from the file's name" the answer is simple - you can't, as this is not how iTunes works.  There are some third-party utilities that you can use to set some metadata element values based on parsing of file names which might be a useful first step.  However, to use iTunes effectively you should really forget about / ignore file names - manage your media using appropriate metadata and allow iTunes to look after file names behind the scenes.

  • Reading Images from JAR Files

    Hi,
    I am having a very difficult time being able to read images from a JAR file via my Applet. I have tried everything that I know about with no luck. The only way I can get this to work is to store the images individually in a sub directory of public_html on the websever. This works, but I would like the images to come down in a JAR file for performance reasons.
    I am using Internet Explorer 5.5 for my browser. I checked the options and everything seems to be in order, but......
    I would appreciate any feedback that anyone might have on this topic..........
    Thank You....

    once in a jar file i inserted a image
    the jar file on clicking starts an frame.
    so the image was for getting that image at the icon place at top and at minimized window
    i could not get that image from jar file by new imageicon().getimage();
    but i get the image if it is in the directory in which jar file is.....
    can one explain the reason

  • Problem loading image from jar file referenced by jar file

    First, I searched this one and no, I didn't find an answer. Loading images from jar files has been pretty much done to death but my problem is different. Please read on.
    I have my application, a straight up executable running from Eclipse. It uses a jar file, call it JarA. JarA launches a GUI that is located in another jar file. Call it JarB. To recap:
    My application calls JarA -> JarA loads classes from JarB -> JarB looks for images to place in a GUI it wants to show on the screen
    When JarB goes to load an image the following happens:
    java.lang.NullPointerException
         at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
         at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
         at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
         at java.lang.ClassLoader.getResource(ClassLoader.java:977)
         at org.cubrc.gmshell.gui.MainWin.preInit(MainWin.java:152)
         at org.cubrc.gmshell.gui.MainWin.<init>(MainWin.java:135)
    The code from JarB that loads the image looks like this:
              URL[] oSearch = {Main.class.getResource("images/")};
              URLClassLoader oLoader = new URLClassLoader(oSearch);
              imgIcon = new ImageIcon(oLoader.getResource("icon.gif"));
              imgMatchRunning = new ImageIcon(oLoader.getResource("gears.gif"));
              imgMatchStill = new ImageIcon(oLoader.getResource("gears-still.gif"));
              imgMagnify = new ImageIcon(oLoader.getResource("magnify.gif"));This looks right to me and JarB certainly has an images directory with those files. But I'm in hell right now because I don't know where to place the images to make this work or if you can even attempt to load images with a dependency chain like this.
    Any help very appreciated!

    Have you tried to move your image-files out of the jar file and place them in the sam folder as the jar-file? I think that would help.
    When you try to load the image-file you get the NullPointerException because the program tries to read a file it can't find. Remember that a jar file IS a file and not a directory.
    If you want to read somthing inside the jar-file you need to encode it first.
    Have you tried to read the jar-file with winRar. It makes it easy to add and remove files in your jar-file.

Maybe you are looking for

  • Data are not showing in a Jsp using link

    i have a Jsp page. in this Jsp page having some links. i want when i click to link of result some data should be display. but it does not displaying. please check the below code. Indus.jsp <html> <head> <title>Indus Public School</title> </head> <bod

  • TEHO with Local Routing Group

    Hi, I was watching an online training video of setting TEHO using Local Routing Group on CUCM 8.6. However somehow I think he configured it wrong. In his example, He used a centralized call processing infrastructure for NY (hosts the CUCM) and CA off

  • Security questions and answers are not being sent to any of my emails. i am unable to use itunes because of this. please help

    I do not know the answers to my security questions. It says the support email is being sent to my email, but I have not recieved any email. please help

  • Design error in N8

    It is the third time that the service control Nokia N8. I have changed it once and it still fails in LKO. The phone locks up, shuts down and restarts on its own. This phone is a major design flaw of NOKIA MODERATOR'S NOTE: We have removed the words t

  • Why does my iMac disconnect from the wifi when it goes to sleep?

    Everytime my iMac (Early 2008) running mountain lion goes to sleep it disconnects from the wifi (I only have wifi available) I then get a 'the browser does not support the :File extension) I'm stuck please help....