×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    26

    overlay an image over another

    hi..

    i am trying overlay an image over another using JSR 234.But when i am using that library i am getting javax.microedition.media.MediaException. here is code that i am using...

    Code:
                            MediaProcessor mediaProc = GlobalManager.createMediaProcessor("image/jpeg");
                            OverlayControl overlay = (OverlayControl) mediaProc.getControl(
                                    "javax.microedition.amms.control.imageeffect.OverlayControl");
    
                            overlay.insertImage(image1, 0, 0, 0);
                            overlay.insertImage(image2, 0, 0, 1);
    
                            Image mimI = (Image) overlay.getImage(1);
                            fileList.set(0, "test", mimI);
    SDK -- nokia N97 sdk v1.0
    OS -- windows vista
    app testing on nokia N-series devices

    thanks in advance..

  2. #2
    Registered User
    Join Date
    Dec 2009
    Posts
    1

    Re: overlay an image over another

    code should use try () catch (MediaException me) {}

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    26

    Unhappy Re: overlay an image over another

    hey..

    i think i got my answer..it may be happening because i am testing my application on nokia n97 which does not support javax.microedition.amms.control.imageeffect package. check here

    please suggest either i am wrong or other workaround if i am right..

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: overlay an image over another

    Sure. If you check the JavaDocs, you'll see...

    createMediaProcessor: throws javax.microedition.media.MediaException - if a MediaProcessor could not be created for the given content type

    The exception was telling you that there is no MediaProcessor for image/jpeg.

    What do you want to achieve?

    Graham.

  5. #5
    Registered User
    Join Date
    Nov 2009
    Posts
    26

    Re: overlay an image over another

    basically i need to show an image overlayed by another image in a List field.I have only seen list that can have only one image..thats why i need an image overlayed with another.so that i can place it in the List.

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: overlay an image over another

    Does this help?

    PHP Code:
    // create new image, the right size to use on the List
    Image imgTemp Image.createImage(WIDTHHEIGHT);
    Graphics gTemp imgTemp.getGraphics();

    // draw background onto new image
    gTemp.drawImage(imgBackground00Graphics.TOP Graphics.LEFT);
    // draw foreground, centred on new image (on top of background)
    gTemp.drawImage(imgForegroundWIDTH 2HEIGHT 2Graphics.HCENTER Graphics.VCENTER);

    // convert to an immutable image
    Image imgForList Image.createImage(imgTemp);

    // use image on List
    myList.append("text"imgForList); 
    Graham.

  7. #7
    Registered User
    Join Date
    Nov 2009
    Posts
    26

    Thumbs up Re: overlay an image over another

    thanks man...it is working xactly as i wanted..

Similar Threads

  1. Image overlay Camera Canvas
    By jonahkhan1 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2009-10-13, 12:29
  2. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  3. how to cut some part of Image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-08-04, 09:05
  4. HELP: Mutable Image to Immutable Image?
    By rj_cybersilver in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-03-26, 09:58
  5. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×