Display Image in RenderingSession problem

Hello friends,

I want to display the custom in the field Html page...

I create an html page that includes data from the static image too...

and I want to display this html page in the field...

IT will display the contents of the string correctly, but it will not display any content of the image in it...

So help where I m wrong or what is my next step to display the image in the field...

My code is: -.

import java.io.InputStream;

import javax.microedition.io.HttpConnection;

import net.rim.device.api.browser.field.BrowserContent;
import net.rim.device.api.browser.field.RenderingOptions;
import net.rim.device.api.browser.field.RenderingSession;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.container.FullScreen;
import net.rim.device.api.ui.container.HorizontalFieldManager;

public class BrowserFi extends FullScreen{
    //HorizontalFieldManager ve=new HorizontalFieldManager(HORIZONTAL_SCROLL);
    private String fontType =Const.GloblefontType;
    String htmlString;
    HorizontalFieldManager vfm;
    BrowserContent content;
    Field field;

public BrowserFi() {
        super(DEFAULT_CLOSE |DEFAULT_MENU );
    try{
        InputStream input = getClass().getResourceAsStream("Tables_with_CSS.html");
        int len ;

         String str = "";
         while(-1 != (len = input.read()))
         {
             //strbuf.append(len)   ;
             str = str + (char) len;

         }
        //System.out.println("String Value-->"+str);

        HttpConnection connection = new HttpConnectionImpl(str);
        RenderingSession renderingSession = RenderingSession.getNewInstance();
        renderingSession.getRenderingOptions().setProperty(RenderingOptions.SHOW_IMAGES_IN_HTML, RenderingOptions.ENABLE_CSS, true);
         content = renderingSession.getBrowserContent(connection,null,null);
         field = content.getDisplayableContent();

         HeaderField head=new HeaderField("Pipe Fitter");

        vfm = new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL|Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR | Manager.HORIZONTAL_SCROLLBAR );
        add(head);
        vfm.add(field);

        add(vfm);

        content.finishLoading();
    }
    catch(Exception e){
        System.out.println("---"+e);
    }
    }

  protected boolean navigationMovement(int dx, int dy, int status, int time) {
      if(dx == -1 && dy == 0)//LEft side movement
        {
            if(!(vfm.getHorizontalScroll() == 0) )
            {
                vfm.setVerticalScroll(vfm.getVerticalScroll());
                vfm.setHorizontalScroll(vfm.getHorizontalScroll() - 20);
            }

        }else if (dx == 1 && dy == 0 )//RIght Side Movement
        {
            if((field.getWidth()-getWidth()) > vfm.getHorizontalScroll())
            {
                vfm.setVerticalScroll(vfm.getVerticalScroll());
                vfm.setHorizontalScroll(vfm.getHorizontalScroll() + 20);
            }
        }
        else if(dx == 0 && dy == -1)//Up side movement
        {
            if(!(vfm.getVerticalScroll() < 0) )
            {
                vfm.setHorizontalScroll(vfm.getHorizontalScroll());
                vfm.setVerticalScroll(vfm.getVerticalScroll()-20);
            }
        }else if (dx == 0 && dy == 1 )//Down side movement
        {
            if((field.getHeight()-getHeight()) > vfm.getVerticalScroll())
            {
                vfm.setHorizontalScroll(vfm.getHorizontalScroll());
                vfm.setVerticalScroll(vfm.getVerticalScroll() + 20);
            }

        }
        //vfm.setFocus();
      return true;
        //return super.navigationMovement(dx, dy, status, time);
    }

}

HTML page have images and CSS files...

I already create package so that images and CSS files...

Thanks in advance...

Hey guys I found myself Solution,

With the help of

public InputStream openInputStream() throws IOException {}
return getClass () .getResourceAsStream ("/" + resName);
        
}

in implements HttpConnection...

as resName is the image in the html page that is discovered by getResource() in RenderingApplication

sustring just the last string of images and transmitted to the httpconnection class it will open inputstream and add images in your Browserfield

And you can display the image in the browser field...

Tags: BlackBerry Developers

Similar Questions

  • Display image on vi as myRio problem

    Hello

    This system supposed to be an easy task, but I don't know why it does not work. I am trying to create a game by myRio 1900 and I'm putting a jpeg image. However, I get an error message or an empty image on the Panel before the myRio Vi (Vi project myRio label) [see photograph below]. On the other hand, if I create the same VI under my computer, the image shows without any problem. What should I do to enlarge a picture on my VI as myRio. I need the image either on this VI because I am creating a program requiring myRio and it may not work properly if it is not under label myRio (I need its integrated sensor). I am attaching a zip file of only the part display image of the commandments and not my whole project easier to visualize.

    Problem in brief:
    Please see the project (as a zip).  The vi computer label works and the vi under myRio does not.

    I want to solve:
    I want to put an image on VI myRio label.

    I have:

    MyRio Labview 2014

    MyRio 1900

    Already tried to: (but unfortunately did not work)

    (1) put the jpeg file in the USB key and plug myRio directly. I gave the file path ' / u/bg.jpg ". (File system)

    2) created by Subvi from 'computer' then it reminds on the (main) vi under myRio. And vice versa (Subvi myRio and MainVI on 'computer')

    Please ask me any questions if you need further information. I will answer as soon as possible.

    Thanks in advance for your help,

    I am very greateful for your time.

    Stephany

    Stephany,

    It seems that reading JPEG/PNG/BMP screws are not based on targets in real time, as your myRIO. As an alternative, you can get our Vision of shared resources (I think you need to install with Vision Development Module), install Vision RT to the myRIO and use the IMAQ ReadFile VI to open the file on the myRIO.

  • last mozilla does not display image in yahoo personals email, just black squares.

    Latest version of firefox does not display image in yahoo personals email, just black squares

    This has happened

    Each time Firefox opened

    is latest update of firefox

    See the problems that cause to not show images and http://kb.mozillazine.org/Images_or_animations_do_not_load

    It is possible that you clicked the 'Block Images' item in the context menu by attempting to save an image.
    Check the image exceptions: Tools > Options > content: Load Images: Exceptions - see the web content, pop-ups, fonts and language settings

    A way to see what images are blocked is to click on the favicon (Site ID icon) on the left side of the address bar and click the button "additional information".
    This will open the Security tab of the window of the Information Page (also accessible via Tools > Page Info).
    Go to the Media of this Page Info window tab.
    Select the first image and scroll though the list with the arrow pointing downwards.
    If a picture is grayed out and there is a check mark in the box of block Images of... then remove this brand in order to unlock the images from this area.

  • I can't display image icons when working with my photo folder. How can I see the photos without having to click on them in preview mode?

    I can't display image icons when working with my photo folder. How can I see the photos without having to click on them in preview mode?

    -It used to work and for some reason, now it does not work

    Greetings, d_chiuch1104,

    There is one thing that I know that you need to check that COULD be your problem.  Open Control Panel (in Classic view) and click Folder Options (or, in Control Panel, click on appearance and personalization and then Folder Options).

    Open the view tab and make sure that "Always show icons, never thumbnails" is NOT checked.

    It would be good to hear from you as to whether that was the problem!

    GL - Bob

  • Album App do not display images of internal storage

    Hello
    I use a ultra Xperia Z

    I always have problems with my album app, it shows no content from the internal memory, but only from SD card. I tried to clear the cache of data and restarted the phone, but it does not help. I recently updated my OS to lollipop 5.1.1 it worked once, but as soon as I plugged the phone on the laptop it stopped to show the content of the internal memory. He gave me problems even if you use 4.4.2

    The version of the album App is 7.3.A.0.4, please make a permanent fix because it's very annoying to have to go through the file Commander to display images from the internal memory.

    Thanks in advance

    When you try to change something on the external SD card using advantage 3:rd app, you must allow access to the application.

    In Total Commander you have to get a popup saying 'Write protected!', then press 'OK', then select the SD card on the left side menu och then press "confirm" at the bottom. Total order then deletes the file.

    And when the file has been deleted, don't forget to erase the data to storage media and then reboot the phone. It can also take a little while for the phone to analyze all of the media, which may take a little while before, you see all the pictures.

    Which you must use the file manager is a matter of preference. You can have both installed if you want to.

  • Image showing strange problem

    Hello

    I am writing a Flex application and tries to display an image in a

    To load an image, I call the following code to a button's click event:

    myImage.source = "http://remote.server/file.png";

    This all works well except if I register a shot toward the bottom of the event in my main application handler.

    QNXApplication.qnxApplication.addEventListener (QNXApplicationEvent.SWIPE_DOWN, onApplicationSwipeDown);

    This seems weird to. Images loading properly if I don't register a listener for the SWIPE_DOWN, but as soon as I register the listener, I can not to display images.  If I just remove this line of code, images appear as expected.

    Has anyone seen something similar to this or any ideas what it could be?

    I'm developing a Flex application in FlashBuilder and try to run on the Simulator Playbook.

    I managed to solve the problem by removing the reference to qnx - air.swc I've had in the project.

    For some reason any pertaining to this seems to stop my app work.

  • Windows Live Photo Gallery: Error Code 0 x 8007000. an error is preventing the photo or video to be displayed, unable to display images.

    I have Windows 7 64 bit. I can't see the photos with Windows Live Photo Gallery. If I try I get this error: error code 0 x 8007000. an error is preventing the photo or video to be displayed, unable to display images. I can open the images with other applications.

    Can you access the properties of the files and check your username on the Security tab on the computer that has problems with them, opening

    Not being able to do something with these points of shared files to a problem of permissions with the files.

    You should also ask for help on this forum,

    Sometimes, it takes 3 or 4 days before a tech react,

    http://windowslivehelp.com/forums.aspx?ProductID=20

    Better put online now.

  • Cybershot - cannot display Image

    so. Disgusted and increased.  Bought this Cybershot DSC-W730 to take a trip to Colorado.  Probably took 30 shots or so and after that of course the image appears in the Viewer on the camera itself so cool, that's where!  EVIL.  On the return plane trip I will look through the travel plans, and more than half of them have a blue screen that says: "cannot display image".  Then I load the software on the computer to download a few shots that ARE there and most of them are just a square with a small blue flower looking icon in the corner... no image. Some of them have a thin line of part of the image.  Where are our pictures?  Thanks for any help.

    It may be possible that the photos you have taken have been corrupt. Using a memory card with the camera? If so, it would be possible that the card is not compatible, not formatted correctly or damaged and corrupt.

    You can try to format the card, but this will clear all the photos you've already taken. Please try to use another memory card to isolate the problem.

    If this post answered your question, please mark "accept as a Solution.

  • XML not displaying images

    I have a problem displaying images from an xml file. It's a portfolio site, so roughly that it displays text and an image. All text works fine, but for some reason any image (and the entire application) does not appear when the code of the image is added.

    Here is my code:

    "" < mx:XML id = "portfolioXML".
    source = "portfolio. XML"/ >

    < mx:XMLListCollection id = "interActXMLList".
    source = "{portfolioXML.interactive.label}" / >

    < mx:List id = "interActList".
    dataProvider = "{interActXMLList}".
    width = "253" height = "103" / >

    < mx:Number id = "selectedWorkIndex" > {interActList.selectedIndex} < / mx:Number >

    < mx:Text
    ID = "titleInput".
    Text = "{portfolioXML.interactive [selectedWorkIndex] .title}".
    width = "446" / >

    < mx:Text
    ID = "description".
    Text = "{portfolioXML.interactive [selectedWorkIndex] .shortDesc}.
    height = "101" width = "446" / >
    <!-this causes it to crash
    < mx:Image
    source = "{portfolioXML.interactive [selectedWorkIndex] .image}" / >
    ->

    XML looks like this:

    < portfolio >
    < interactive >
    < label > The point < / label >
    < title > element < /title >
    < shortDesc > the question is totally awesome. < / shortDesc >
    < image > http://www.example.com/images/interactive/item.png < /image >
    < / interactive >
    < / portfolio >

    The url is correct (it works when I hard code). Anyone know why images do not work?

    In my tests, I found the var 'selectedWorkIndex' to be the problem. In fact, it's a timing issue as this var is not set before trying to load the image. I reinforced with your code and I saw that the image will load before your number var is defined. Bad luck. That causes the error.

    If you need to write a little Actionscript code to define things upwards and load the image correctly.
    I created a var for the SOURCE property of the image control, and I put this var in the creationComplete for the app Manager and a handler for the event of CHANGES to the list. Voila!

  • Firefox manages not to display images much (but not all) on the Web sites that I visit, certain images are displayed and some are not even if they are in the same format.

    I recently changed my ISP because I had connectivity problems. Especially my router would be closed sporadically. As part of my attempt to identify issues, I ran some spyware that I was told that I could trust. Since then, I have a problem looking at many websites as much (but not all) images are missing, even on websites that I know very well, including my own. What is odd, is that on one site each page has an image jpg under the navigation bar and all these jpg appear except for one who does not even appear when I reload images. This problem also makes security of sensitive sites as my amateur full site look Bank that scares me. The problem does not occur on other web browsers.

    What spyware software do you run?

    Make sure that allow you pages to choose their colors and you have not enabled high contrast in the Windows accessibility settings.

    • Check the permissions for the domain in the active tab in "tools > Page Info > Permissions.
    • Check that the images are enabled: Tools > Options > content: [X] loading images automatically
    • Check exceptions in "tools > Options > content: Load Images > Exceptions.
    • See the tab "tools > Page Info > media ' for blocked images (scroll all the images with the cursor key).

    If an image in the list is grayed out and there is a check mark in the box "block Images of..." and remove this mark to unlock the images from this area.

    There are also extensions (Tools > Modules > Extensions) and security software (firewall, antivirus) that can block images.

  • Satellite Pro 6000: display or graphics card problem

    Hello
    I don't have a model satellite pro 6000. PS600E-01NYE-FR
    1 GHz P3, 20 GB HDD, wireless bluetooth not running XP

    I understand that it is an old laptop but had been treated with great care because I got it.
    My problem is the following;

    Startup of the laptop is a route very well, but for some reason together and after no set amount of time the display fails
    a wot is visible on-screen is hundreds of tiny colored blocks, sometimes random horizontal lines
    but nothing is readable, at all.

    I tried to run a yellow one also using the video output external monitor, all appear the same.
    a computer display (although I can't check it out) to freeze.

    I replaced the heatsink fan as a precaution (using the new dough)
    the only solution I can find is replaced the ram with
    2 x 256 MB Sync 133 mHz module Samsung. This could be the problem or can anyone shed some light on this for me.

    Thanks in advance
    Display Toshiba SP6000 (?) Problem

    I am not a technician, but I assume that there is probably a problem with the video card. I'm afraid there is not much to do. You should contact the service and make them run tests to verify the functionality of the video card. If the card is faulty, just replacement will help.

  • When "allow pages to choose their own colors, instead of my selections above" is not checked in the menu options, I can't see images on Web sites. How can I maintain with the box unchecked and always display images?

    I recently decided to spend autour colours in Firefox. I work in a fairly dark environment and have the dark color on white or light background text is quite difficult on my eyes in the dark.

    I changed the background to a dark gray, light gray text and visited the two and links not visited in a blue light. With these changes, I unchecked the "allow pages to choose their own colors, instead of my selections above" box.

    After unchecking the box, I'm more able to display images on many sites. Turn all grey images - as if Firefox has changed their image in part of the background. When I check the box, I am able to see fine pictures, however, Web sites typically return to their light background with dark text.

    Any help and assistance with this is greatly appreciated!
    Thank you!

    You can use the NoSquint extension to define the font size (zoom text/page) and colors of text on web pages.

  • Display images from a folder

    I'm looking to display images from a folder of images containing mostly jpg images. I want to be able to display images on the façade and cycle through them with a button. How can I do this?

    LabVIEW 2013

    This is the solution, if anyone needs

  • How to adjust display image horizontal display

    everytime I turn on my labtop, the image would jump to display vertically and not horizontally, which is the setting of display image of normal labtop, what key I have by mistake, press

    High graphics most of range, the cards are equipped with display rotation built in and adjustable via display properties or via the display properties of the display icon in the Notification area (to the left of the system clock).  It is a nice feature if you want to read things more like a book on your laptop, etc.

    Some examples would be ATI, NVIDIA, Intel, Matrox, S3, XGI...  These adapters can be integrated into your system, and not always his own card.

    This phenomenon of rotation screen sometimes inadvertently some keystrokes (the cat walked on my keyboard).

    Pressing on the keys Ctrl-Alt top/arrow down arrow rotates screen 90 degrees at a time for some graphics (like NVIDIA) cards

    If this does not work, we will need to know your system brand and model and see if we can look at the rotating screen for you shortcut keys.

  • sidebar on the desktop are not displayed images of only a red cross

    sidebar on the desktop are not displayed images of only a red cross

    Take a look at the following:

    Sidebar Gadget not working not properly
    Note: look for responses from the veebull
    and president of the DNA
    http://social.technet.Microsoft.com/forums/en/itprovistadesktopui/thread/5d734cdb-757f-4801-8f28-3cca36ccf7ba

    How can I restore windows sidebar
    http://support.Microsoft.com/?kbid=963010

    How to fix broken sidebar
    http://www.howtogeek.com/HOWTO/Windows-Vista/how-to-repair-your-crashed-or-hanging-Vista-Sidebar/

Maybe you are looking for

  • I get "400 Bad Request"

    There a webpage "PCH" after I click on continue or that you expect the page to do what ever, is what according to confirm you.

  • Bbookmarks are not there in my install nerw

    I had a real problem trying to get rid of search bing search engines and the web, so I decided to remove and reinstall new firefox. I copied the bookmarks places.sqlite file and the file downloads.sqlite of my profile, uninstalled and deleted all per

  • How to fix important ports for messenger

    Ive been trying to connect to windows messenger for almost two weekes and it won't work I check to fix the button and it stops in major ports how can I fix this

  • How can I change the way application are displayed or open

    How to apply for a given online, to open or change it from wordpad open

  • cannot change default Windows Media Player .wmv.

    Whenever I get an attachment to a .wmv file, it is always default to Nero Showtime Essentials.  I go to my default programs icon in the control panel and change to Windows Media Player.  It changes accordingly.  Next time I get another .wmv file, I h