How to display the Image on the screen.

I was New in aid of BB.Plz.

I am facing the problem is, I go get web Image.

But how do I show on the extraction of Screen.For that I write code like this,

If there's a problem with this code, then how may - I, please Hepl me out.

import java. IO;
Javax.microedition.io import. *;
Net.rim.device.api.ui.component import. *;
Net.rim.device.api.ui.container import. *;
Net.rim.device.api.ui import. *;
Javax.microedition.lcdui import. *;
Javax.microedition.midlet import. *;

showImage class extends FieldChangeListener implements screen
{
ButtonField down;
Image img;
ImageItem IM/it;
public showImage()
{
LabelField title = new LabelField ("Image Download Example", LabelField.ELLIPSIS |) LabelField.USE_ALL_WIDTH);
setTitle (title);
down = new ButtonField ("Download");
down.setChangeListener (this);
Add (Down);
       
}
    
Public Image startImage()
{
String url = "http://media1.santabanta.com/full4/bikes/triumph/triumph-20d.jpg";
HttpConnection hc = null;
DataInputStream tell = null;
Try
{
HC = (HttpConnection) Connector.Open (URL);
hc.setRequestMethod (HttpConnection.GET);
int st = hc.getResponseCode ();
if(St==HttpConnection.HTTP_OK)
{
int len = (int) hc.getLength ();
System.out.println ("==> Code" + hc.getResponseCode ());
System.out.println ("Message ==>" + hc.getResponseMessage ());
BTS Byte = new byte [len];
tell = new DataInputStream (hc.openInputStream ());
dis.readFully (bts);
IMG = image.createImage (BTS, 0, Len);
tell. Close();
HC. Close();

}

} catch (Exception e) {}
return img;
}
' Public Sub fieldChanged (field f, int c)
{
if(f==Down)
{
Image image = startImage ();
Add (image);
}
}
}

Take a look at these classes:

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.EncodedImage;
import net.rim.device.api.ui.image.Image;
import net.rim.device.api.ui.component.BitmapField;

This code should do you need:

        EncodedImage image = EncodedImage.createEncodedImage(data, offset, length);
        BitmapField bitmapField = new BitmapField();
        bitmapField.setImage(image);
        add(bitmapField);

Tags: BlackBerry Developers

Similar Questions

  • How to display the width of the page or the big screen in firefox 11 automatically?

    How to display the width of the page or the big screen in firefox 11 automatically? I know how to Ctrl +, ctrl - and ctrl 0, but is there a way to define 11 firefox to automatically set the page viewing by default "page width" or full screen (F11 not)?
    Help, please. Thank you.

    You can use an extension to set a page zoom and the size of the default font on the web pages.

  • display HP 7 voice tab broken, unfortunately. tab is under warranty... How to replace the screen

    display HP 7 voice tab broken, unfortunately. tab is under warranty... How to replace the screen

    HP India never have bad service. I hv order three books "hp 15-ac026tx" before five days for the company. Distributior open boxes. But at the time of installation pilot not single manager of the graphics card, 2 GB. As a Distributor, realized with the support of Hp, they said that the engineer will soon be at your place. But still no one came. And im going to cancel this order and will prefer another compony.

  • How to display the image in the center of the imageview window?

    How to display the image in the center of the imageview window, if the image is smaller than the window...

    Page {
        Container {
            layout: DockLayout{}
            verticalAlignment: VerticalAlignment.Fill
            horizontalAlignment: HorizontalAlignment.Fill
            ImageView {
                imageSource: "asset:///images/image.png"
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
            }
        }
    }
    
  • How to display multiple images at the same time in CS6?

    How to display multiple images at the same time in CS6?

    Hello

    If you go to window > reorganize you can choose from several display options. Below, I have chosen two horizontal spaces since I have two images, but you can select other options if you have more than one image.

  • How to split the screen of my mac book

    How to split the screen of my Macbook?

    There may be a solution on how to split the screen into two (halves) for independent display

    through the use of third-party software options. I haven't tried everything, but have read of some who can work.

    Such a "solution party' appears in the Mac App Store; See the second link to the manufacturer.

    https://iTunes.Apple.com/us/app/split-screen/id453757310?MT=12

    • Split screen - Mac app for windows (approximately $7 USD) display management

    http://www.splitscreenapp.com/

    There may be others, beware of questionable sources, as they may contain others? content.

    This may work on a Mac, not a portable desktop computer:

    • Apple introduced mode split for the apps full screen on a Mac in OS X El Capitan - 9to5Mac.com:

    http://9to5Mac.com/2015/06/08/Mac-split-screen-multitasking/

    In any case...

    Good luck & happy computing!

    under the direction

  • Equium A60: How to clean the screen

    Hi... using equium A60 for 4 years.
    There are fingerprints and marks on my screen for a long time, I tried to wipe with a cloth dampened in water, to my surprise, that would leave more big brands then before. Brands are not visible when the system is running IE screen is turned on, but clearly visible when the system is off.

    Can someone suggest me please how to clean the screen at home.

    Thank you verymuch...

    Hello

    Each computer dealer provides some products own display interesting and useful.
    You can use a lint cloth and a special spray to clean the screen.

    Would you recommend to visit your laptop & computer dealer following and ask these vaporizers

  • How to turn the screen 180 degrees?

    How to return the screen to normal autour.  Right now, everything is upside down.  Some how the screen flip when I was using the mouse near the bottom of the screen and can of it a key @ simultaneously.  Help, please

    Tuesday, February 14, 2012 14:59:24 + 0000, ANTHONYPINO wrote:

    How to return the screen to normal autour.  Right now, everything is upside down.  Some how the screen flip when I was using the mouse near the bottom of the screen and can of it a key @ simultaneously.  Help, please

    The ability to rotate the screen image is a characteristic of your video
    card, to help work with instructors who turn to the portrait
    orientation. Almost certainly you accidentally pressed Ctrl-Alt, and
    an arrow key.
    Rotate using these keys.

    Ken Blake, Microsoft MVP

  • How to display the date on the taskbar (toolbar)

    Please tell me how to display the date at the bottom of the screen.  Currently, everything is displayed is the time.

    Hello

    You said in addition to the clock so I initially think not that you need it however, others said it would be a good idea to show this method of date display. Also if you move the taskbar vertically the date is also displayed.

    Always see the day, date and time in the taskbar
    http://freewindowsvistatutorials.com/meetWindowsVista/taskbarAndSystemTray/showDayDateAndTimeInTheClock.php

    You can lift the taskbar is higher - make a right click on it - uncheck box lock the taskbar then take the upper part of it and lift it higher and the date will be under the clock.

    --------------------------------------------------------------------

    I found a utility that does on one level of the bar tasks if it does not have to be raised-
    T - clock - free - 3 references to it:

    Windows7 like clock on the system in Vista & XP tray
    http://www.tothepc.com/archives/Windows7-like-clock-on-system-tray-in-Vista-XP/

    TClock: See the Date Look like Windows 7 & time in the system tray in Windows XP and Vista
    http://www.askvg.com/tclock-show-Windows-7-look-like-date-time-in-system-tray-in-Windows-XP-and-Vista/

    T - Clock of the Stoic Joker
    http://www.greggdeselms.com/tclock.html

    I hope this helps.
    --------------------------------------------------------------------------------------------
    Rob Brown - Microsoft MVP<- profile="" -="" windows="" experience :="" bicycle="" -="" mark="" twain="" said="" it="">

  • PAVILION 22xi: COME PULIRE LO DEL PAVILION 22xi SCREEN / HOW TO CLEAN the SCREEN OF THE 22xi of FLAG?

    COME PULIRE LO DEL PAVILION 22xi SCREEN?

    Inoltre:
    Come rimuovere eventual aloni esistenti da previous pulizie?

    HOW TO CLEAN the SCREEN OF THE 22xi of FLAG?
    In addition:
    How to manually remove existing halos of previous cleanings?

    Hi there @antonio55,

    That the Forums are with you!  I understand that you are looking for advice on how to clean your screen.  I'm happy to give you a helping hand with this.

    Please see: HP monitors - Safety and Maintenance Guidelines, under the heading "Cleaning the monitor" for details of cleaning, but be sure to read both safety related information.  Depending on what you mean by "halos" try following the instructions for the materials to be used. If you have in the past used something on the list of cleaning products do not turn out to serve, you may have already damaged a part of the screen.

    Please let me know if it works for you and if it does not solve your problem, please mark this message as a solution. Bravo would be appreciated as well.

  • How to clean the screen of my laptop Trubrite?

    Any suggestions on how to clean the screen of my laptop Trubrite? He had a lot of ideas in the web, but none of them were convincing enough?

    For my LCD to computer, I bought liquid cleaning screen and I use it with a non fluffy cloth.
    It s a perfect ;) combination

  • How to replace the screen & HDD in Tecra S1

    Could someone help me with 2 queries?
    1. how to replace the screen? I broke my screen 15 "and have a replacement original but would like to know if this is possible without the help of the reseller, etc.
    2. bad drive c. message is 992 KB bad clusters. How to replace or repair the C drive?
    Thank you
    BL

    Hello

    Well, the replacement of HARD disk drive is very easy on the Tecra S1.
    At the bottom of the unit, you will find a cover that protects the HARD drive Bay.
    A screw covers. Remove it.
    Then, it should be possible to remove the HARD drive.

    The replacement of the screen is another matter. It is not easy to remove it. In this case I recommend to contact Toshiba service in your country for details.

  • Satellite L30 - 11 d - how to exchange the screen?

    Hello

    I need help to change the screen on a Satellite L30 - 11 d. I accidentally pressed the screen that has a large black spot on him.

    Everything can show me how to change the screen with a new one please?

    Hello

    Unfortunately, you won't find manuals or on the pages of Toshiba disassembly instructions.
    I think that these instructions are made for service technicians only and are not for public use

    In any case, I think there is a lot of information on the internet and I think if you really need this info, then you should google a bit.
    But once again; It s always best to ask a technician for aid of the disassembly procedure is complicated and there is a high risk of damage this part.
    In the worst cases, damage another essential element which would be too expensive.

  • Help! My iPod Classic 120 G froze. Pale = 'Media-In' and display the screen = "OK to disconnect with a bar in the middle." Tried the reset procedure, press the "Menu and Center." Without success. Any ideas?

    Help! My iPod Classic 120 G froze. Pale = 'Media-In' and display the screen = "OK to disconnect with a bar in the middle." Tried the reset procedure, press the "Menu and Center." Without success. Any ideas?

    See Re: corrupted iPod classic. If she does not really have a reset set it aside and let the battery completely discharge. It should reset itself when you load again.

    TT2

  • How to display the drop-down list box in MS excel by using labview report generation toolkit? pleasepost code block diagram?

    How to display the drop-down list box in MS excel by using labview report generation toolkit? Please post the block diagram of the code so that I can able to generate from the drop-down list box in excel with the menu drop-down...

    Like this. (edition, use the reference forms instead of the reference to the worksheet)

    Ben64

  • How to display the list of components in ultiboard 10?

    The DRC report the errors where the components that are no longer in the design have been removed. How to display the list component and then remove them from the netlist to stop this?

    Ultiboard reported missing errors of component (part 'X' is not about design) because the part is always referenced by a net. To fix this, you must remove the part of the net. Following the steps below to remove the part form the net.

    1 tools > Netlist Editor

    2. for each network that the part has been connected to, select the Net (upper-left).

    3. Select the tab of pine trees, select the part and it is the PIN in the dialog box, then click on remove

    The problem is when the part is removed, I see no easy way to determine the threads you need to remove the part of. I entered this as a feature request to make this easier, but as a workaround, you can put part and say Ultiboard what the missing part, then search the net names on the pins and remove the part of these pins

    1 place a piece with a lot of pine trees (for example the part that was removed, or for example through Hole technology > Connectors > SIL & headers > HEADER2X9). When you place the part, make sure that the RefDes matches the RefDes of the part which has been removed.

    2. once the room is placed, you should see rats nest lines that connect the part to the nets.

    3 Zoom on the pins. You should now see the net name on each of the axes. For each of the pins connected, remove it from the net as described above.

    4. remove the part that you placed.

Maybe you are looking for