How do i shrink images using J2ME ???

Hi Guys, i have a large image to be displayed, how do i shrink it to the size of the phone display and have it displayed ?

do u have any idea how do i do it on server side using servlets
i can't seem to find any io streams that supports image object
this is not my homework !!!
i currently working on a project

Similar Messages

  • How to create bookmarks by using J2ME

    Hi! Does anyone knows how to create bookmarks by using J2ME?

    hey , did u get any help on this?
    --vijay
    Hi! Does anyone knows how to create bookmarks by
    using J2ME?

  • How to send picture message using J2ME sms APIs?

    Hi,
    I experiment with SMS APIs, i successfully send simple text message. now i want to send picture message, how to send picture message using J2ME APIs.
    please guide me.
    guna.

    I experienced in coding sending and receiving sms in J2ME. Besides, I also esperienced in coding reading a binary file in a applicaition jar. But I never done these both together. Hence Im not sure it works or not. Below is the example to open and read a binary file:
    InputStream oInputStream = getClass().getResourceAsStream( "/picture.png" );
    if(oInputStream == null) {
    //File does not exist;
    throw new Exception("File not found");
    //Read the binary file and copy it to a byte array
    byte[] abyPicture = new byte[oInputStream.available()];
    oInputStream.read(abyPicture );

  • How to display dynamic images using Struts

    I am storing the image name in bean. I want to use the <html:img> tag to display my images. How can i do that using struts.
    Something or sort..
    <html:img src=bean:write name="pageEntry" property="pageImg"/>
    Thank You

    * In your web.xml file, add the struts-html-el.tld definition from the struts\contrib\struts-el\lib directory
    * Add this tag library to your JSP page; something like:
    <%@ taglib uri="WEB-INF/struts-html-el.tld" prefix="html-el" %>* Refer to the following example:
    <html-el:img src="${pageEntry.pagePic}" />* This assumes that pageEntry is a Bean, and pagePic is a bean variable accessed by the getPagePic() method.

  • Can you guide me how to mirror an image using Photoshop CS4 ME ?

    hello guys...
    as I was surfing the InDesign forum, I just found this which is exactly like the question I was about to ask, but since I read that it's not that easy to do it with InDesign, I am sure that it's doable by Photoshop, but how ???
    any way to do it ???
    thank you very much .

    Unfortunately I'm not too good for recommending good tutorials, as I'm almost 100% self-taught (experiment, try, fail, try again, succeed, that kind of thing).
    A Google search for "create mirrored image using Photoshop" does turn up a lot of tutorial content, e.g., http://www.photoshop911.com/tricks/mirror_image.html
    With Photoshop you can do anything to an image given sufficient time and effort.
    Enjoy the journey!
    -Noel

  • How do I load images using nio?

    Beyond using the toolkit to load an image, I don't know how to load an image. I looked at the javax.imageio package briefly, but I'm not sure where to start there.
    I would like to be able to load images with nio Ii.e. memory map the files) and display them on screen.
    Any advice and help would be appreciated.
    Thanx
    Bill

    from java api 1.4
    BufferedImage bi = ImageIO.read(File)
    BufferedImage bi = ImageIO.read(InputStream)
    BufferedImage bi = ImageIO.read(ImageInputStream)
    BufferedImage bi = ImageIO.read(URL)

  • How to display an image using MIDP on Palm?

    How can I display an image using MIDP on Palm? The following code works on the Siemens SL45i, but not on Palm:
    public class Test extends List
    Image image = Image.createImage("/images/test.png");
    append("item 1", image);

    Have found the exact same problem when trying to display an image (other then the default (null)) in a list, on a Palm.
    The image displays correctly on a form, but when set on an element in the list, it does not display. (mind you this is in both emulator mode and on the real device)
    It does not seem to be related to size of the image.
    The Sun documetation states, that you should not rely on it been displayed (obviously it's an implementation issue with the Palm, and other devices I have not tried)
    But like to hear definitively from Sun though!

  • How to change the images used in the "Named people" tiles?

    After working on adding people/faces for a while, I find that in many cases the image used in the "Named people" tile for a particular person is the worst one possible.
    Is there a way to tell Lightroom to use a different image?

    Agreed. The people grid looks horrible after a while. I went looking for a way to identify a key tile and couldn't find it.

  • How to record an audio using j2me

    hello i'm new to this.
    i have some sample code to record audio in wireless toolkit
    but i got error in "setOutputStream()"
    this is my code.any one help me....................
    code :-
    ====
    try
    // create the Player object using amr encoding
    p = Manager.createPlayer("capture://audio?encoding=pcm");
    p.realize();
    // get the RecordControl over this Player
    RecordControl rc = (RecordControl)p.getControl("RecordControl");
    // create an OutputStream which the RecordControl will use
    // to write write the recorded data.
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    rc.setRecordStream(output);
    // start the recording
    rc.startRecord();
    p.start();
    messageItem.setText("recording...");
    Thread.currentThread().sleep(5000); // record for 5 seconds
    messageItem.setText("done!");
    rc.commit();
    // save the recordedData in a byte array
    recordedSoundArray = output.toByteArray();
    // close the player
    p.close();
    } //try
    catch (IOException ioe)
    errorItem.setLabel("Error");
    errorItem.setText(ioe.toString());
    catch (MediaException me)
    errorItem.setLabel("Error");
    errorItem.setText(me.toString());
    catch (InterruptedException ie)
    errorItem.setLabel("Error");
    errorItem.setText(ie.toString());
    }//if

    hai all,
    im new here ..i have problem in recording audio using j2me..my code is as below
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.media.control.RecordControl;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    public class recordMidlet extends MIDlet implements CommandListener
    private Form init = new Form("info");
    private Command rec = new Command("rec",Command.OK, 1),
    stop = new Command("stop",Command.STOP, 0),
    exit = new Command("exit",Command.EXIT, 0);
    private byte[] recordedSoundArray;
    private Player p;
    private RecordControl rc;
    private ByteArrayOutputStream output;
    public void startApp()
    init.addCommand(rec);
    init.addCommand(stop);
    //init.addCommand(exit);
    init.setCommandListener(this);
    Display.getDisplay(this).setCurrent(init);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
    public void commandAction(Command com, Displayable dis)
    if(com == exit)
    notifyDestroyed();
    else if(com == stop)
    init.removeCommand(stop);
    init.addCommand(exit);
    try
    init.append("finish record... starting playback\n\n");
    rc.stopRecord();
    rc.commit();
    p.stop();
    p.close();
    init.append("playing...\n");
    recordedSoundArray = output.toByteArray();
    init.append("recorded sound = " +String.valueOf(recordedSoundArray.length)+"\n\n");
    ByteArrayInputStream recordedInputStream = new ByteArrayInputStream(recordedSoundArray);
    Player p2 = Manager.createPlayer(recordedInputStream,"audio/x-wav");
    p2.prefetch();
    p2.start();
    //init.append("finish playing...");
    catch (Exception e) {
    init.append("stop command: "+e.toString());
    else if(com == rec) {
    try {
    init.append("record voice ...\n\n");
    // Create a Player that captures live audio.
    p = Manager.createPlayer("capture://audio?encoding=pcm&rate=8000&bits=16");
    p.realize();
    // Get the RecordControl, set the record stream,
    rc = (RecordControl)p.getControl("RecordControl");
    output = new ByteArrayOutputStream();
    rc.setRecordStream(output);
    rc.startRecord();
    p.start();
    } catch (Exception ioe)
    init.append(ioe.toString());
    i get error from ktoolbar window..
    Warning: To avoid potential deadlock, operations that may block, such as
    networking, should be performed in a different thread than the
    commandAction() handler.
    Emulator is not working after that..and it jus shows text
    " RecordMidlet wants to record an audio clip.is it ok to record? then the emulator hangs..
    could someone help me to solve this problem..is there any setting problems in j2me wireless toolkit ?
    im using J2me wireless toolkit 2.5 for CLDC beta 2 .
    thanks to all.

  • Anyone how to resize an image using imagereader and imagereadparam?

    I want to use imagereaderparam to process the image.
    MY code is as follow:
    ImageReader reader = _editor.getImageReader();
         try
         if (reader != null)
                   int w = reader.getWidth(0);
                   int h = reader.getHeight(0);
                   ImageReadParam param = reader.getDefaultReadParam();
                   //param.setDestination(reader.read(0));
                   Dimension d = new Dimension(my_width, my_height);
                   param.setSourceRenderSize(d);
                   BufferedImage bi = reader.read(0, param);
         } catch (Exception e)
              e.printStackTrace();
    This code just not work , and get an exception
    java.lang.UnsupportedOperationException: Can't set source render size!
    anyone know how to do that ?
    coz i dont want to use getScaledImage...

    Hi,
    Are you just trying to produce a BufferedImage at a smaller size? May I ask why you don't want to use getScaledInstance? I agree with you not to use it. It is slow. Just wondering what your reasons are. If all you need is to take one image and make it a different size, try this:
    BufferedImage src = ...
    int scale = 0.5f;
    int w = (int)(src.getWidth(null) * scale);
    int h = (int)(src.getHeight(null) * scale);
    // could use TYPE_INT_RGB if there's no alpha in your image
    BufferedImage dest = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    Graphics g = dest.getGraphics();
    g.drawImage(src, 0, 0, w, h, null);
    d.dispose();How does that work for you? It should be pretty quick.
    Shannon Hickey (Swing Team)

  • How do I straighten images using Photoshop CS2?

    Can someone please tell me how I straighten images like horizons and buildings using Photoshop CS2?
    I run the software under Windows XP
    Thank you.

    What I do is press Ctrl-T which activates Free Transform. I press Ctrl-" which turns on the grid. I can then rotate the file to correct a drooping horizon, or I can Right-Click on the image to activate the contextual menu, and select Skew. In that mode, I can grab a corner and drag it up or down, right or left, to shift or tilt the image.
    Another way to level horizons is to use the Measure tool and from the menu, <Image>, <Rotate Canvas>, <Arbitrary>. You use the Measure tool to draw a line from one part of the horizon to another. When you click Arbitrary you'll get a little dialog. Click <OK> and the image rotates. You'll need to deal with cropping next since your image no longer fills the corners.

  • How to overlap an image using css in my .cfm

    Hi, I know this is a little off-topic, but in my gallery.cfm,
    I have a couple of rows that have an image in it, I was wondering
    how I can use css to put some text over the image? Like for
    example, how can I put some red text "Sold out" over toy1.jpg? I
    have tried using z-index but that requires some positioning but in
    this case there is no positions ? Can someone please help me on
    this?
    Sample code:
    <table align="center">
    <tr>
    <td>
    <img src="images/toy1.jpg" width="128" height="180"
    border="0">
    </td>
    </tr>
    <tr>
    <td>
    <img src="images/toy1.jpg" width="128" height="180"
    border="0">
    </td>
    Thank you,
    C

    Hope this helps.
    <style type="text/css">
    .cell {position:relative;}
    .productImage {top:0px; left:0px; width:128px; height:180px;}
    .soldText {position:absolute; top:30px; left:0px;
    font-size:2.0em; color:red; width:100%;
    text-align:center;
    font-family:impact,lucida console,verdana;
    opacity:.8}
    </style>
    <table align="center" border="2">
    <tr>
    <td>
    <div class="cell">
    <div class="productImage"><img src="images/toy1.jpg"
    width="128" height="180" border="0"></div>
    <div class="soldText">Sold!</div>
    </div>
    </td>
    </tr>
    <tr>
    <td><div class="cell">
    <div class="productImage"><img src="images/toy1.jpg"
    width="128" height="180" border="0"></div>
    <div class="soldText">Sold!</div>
    </div>
    </td>
    </tr>
    </table>

  • How to display large image using JAI

    dear all,
    could anyone tell me how do i display an image which is around
    5000x5000 pixels in JAI. I try to use BufferImage to store the image
    but JVM throws" out of memory " error while program is running.
    thanx a lot!

    just a rough estimate, but a 5000x5000 image would require at least 24MB assuming each byte is one pixal, I believe they are 4 bytes per pixel in RBGA format. (5000*5000) = 25,000,000 pixals /1024/1024 = 23.8MB for 1 byte pixals, *4 for 4 byte = 95.3MB. I'm pretty sure that this is how it stores it. Maybe I'm wrong but it certainly explains the situation. assuming you have at least 256MB ramm, run java with -Xmx200M and see what happens.
    java -Xmx200M app
    or if you have more ramm, like 512, use 450 or 500.

  • How do I access images used in Tutorials on AdobeTV?

    I'm trying to follow the tutorials on AdobeTV to familiarize myself with Illustrator CS6.  The instructor uses preloaded artwork, layers and images to teach and I don't know how to follow along without accessing those images.  Are they available for download, or included in the CS6 package?

    Depends on the tutorials. Not all fiels are avialable to the users, some are stock content from the programs, otehrs may require registration at lynda.com, some are avialable from Adobe Exchange....
    Mylenium

  • Is there an example somewhere that shows how to acquire StillColor images using IMAQ Vision calls?

    I need to be able to acquire images from both composite and RGB channels. I am also confused of how to display them and modify display settings as go from color to grayscale to binary.Thanks.

    Jerry,
    I have attached a CVI example for doing stillcolor acquisition. If you are using LabVIEW, there should also be shipping examples for stillcolor acquisition under labview\examples\imaq\imaq color.llb
    To configure your imaq board for stillcolor acquisition, please refer to the following KB
    http://digital.ni.com/public.nsf/3efedde4322fef198​62567740067f3cc/cc743c416e390c008625683f007562c7?O​penDocument
    Hope this helps.
    Ken Sun
    Applications Engineer
    National Instruments
    Attachments:
    advanced_stillcolor.c ‏8 KB
    advanced_stillcolor.h ‏3 KB
    advanced_stillcolor.uir ‏19 KB

Maybe you are looking for