Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2003
    Location
    Bangladesh
    Posts
    41

    transparent image

    how can i create a transparent mutable image??

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    The Nokia UI way:
    Code:
    Image im = DirectUtils.createImage(WIDTH,HEIGHT,0);
    The MIDP 2.0 way:
    Code:
    int[] pixels = new int[WIDTH * HEIGHT];
    for (int i = WIDTH * HEIGHT - 1; i >= 0; i--)
      pixels[i] = 0;
    Image im = Image.createRGBImage(pixels,WIDTH,HEIGHT,true);
    In standard MIDP 1.0 there is no way.

    shmoove

  3. #3
    Registered User
    Join Date
    Oct 2003
    Location
    Bangladesh
    Posts
    41
    thanks,


    but when drawing which Graphics object to use?

    the normal g, or the NokiaUI g?

    what i am trying to do is that ,
    i want to draw two mutable images on the screen,
    the background will scroll slower than the foreground, and the foreground should be transparent.

    thanks again.

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Once you created the image as a transparent image, you can use the regular graphics (MIDP 1.0).

    shmoove

  5. #5
    Registered User
    Join Date
    Oct 2003
    Location
    Bangladesh
    Posts
    41
    i want to draw two mutable images on the screen,
    the background will scroll slower than the foreground, and the foreground should be transparent.


    but the foreground doesnt stay transparent.


    i did it with the nokia ui.

    what do u suggest??

  6. #6
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    It should work with the regular Graphics object.
    Maybe if you post the relevant code (how do you create the image, and how you paint it)....

    shmoove

Posting Permissions

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