×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    5

    Question super-impose one image to another image in j2me

    How can i superimpose one image to another image in j2me?

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: super-impose one image to another image in j2me

    Quote Originally Posted by sanjeevkate View Post
    How can i superimpose one image to another image in j2me?
    Hi, Sanjeev

    see the #3 in this link: Displaying two image at a time

  3. #3
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: super-impose one image to another image in j2me

    [QUOTE=sanjeevkate;773451]How can i superimpose one image to another image in j2me?[/QUOTE

    Get the Graphics Instance from 1st image:
    Graphics ig=1stImage.getGraphics();

    Use this ig to draw the 2ndImage on it.

    then display the 1st image on the device.
    Thanks,
    Ekta

  4. #4
    Registered User
    Join Date
    Sep 2010
    Posts
    5

    Re: super-impose one image to another image in j2me

    hi Rahul,

    But I am not able to open the document hyperlinked "Display two image at a time".

    Thanks.

  5. #5
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: super-impose one image to another image in j2me

    Quote Originally Posted by sanjeevkate View Post
    hi Rahul,

    But I am not able to open the document hyperlinked "Display two image at a time".

    Thanks.
    See this code :

    Code:
    import javax.microedition.lcdui.*;
    
    public class MyCanvas extends Canvas {
        
        public void paint(Graphics g) {
            try {
                Image img1=Image.createImage("/src/a.PNG");
                Image img2=Image.createImage("/src/b.PNG");
                //Display the first image
                g.drawImage(img1, 0, 0, Graphics.TOP|Graphics.LEFT);
                //Display the second one
                g.drawImage(img2, 0, 0, Graphics.TOP|Graphics.LEFT);
            }
            catch(Exception e) {
                
            }
        }
        
    }

  6. #6
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: super-impose one image to another image in j2me

    This will work good if the img2 is semi or fully transparent in which case img1 will also be visible.
    Thanks,
    Ekta

Similar Threads

  1. threading image to a gif image ? (j2me)
    By intheworldofmyown in forum Mobile Java General
    Replies: 3
    Last Post: 2008-11-18, 17:31
  2. Displaying one image on top of another image in J2ME
    By amishra in forum Mobile Java General
    Replies: 13
    Last Post: 2008-11-17, 08:35
  3. How to convert a JPEG image to a PNG image using J2ME Code
    By hussain_afs in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2007-12-31, 16:48
  4. Series 40 - image resizeing and drawing black and white only a part of an image
    By ionutianasi in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2003-07-21, 10:36
  5. Replies: 0
    Last Post: 2003-05-12, 17:38

Posting Permissions

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