×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2013
    Posts
    37

    [Help]Transparent fills..

    I want the code to draw transparent rectangle in j2me.. I searched but couldnt get anything useful.. So please could you please give me the code to draw transparent rectangle.. My background colour is black and the rectangle colour of will be white..

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: [Help]Transparent fills..

    Quote Originally Posted by subha095 View Post
    My background colour is black and the rectangle colour of will be white..
    And what do you mean on "transparent"? So far you could draw a full-screen opaque black rectangle as background and an opaque white rectangle somewhere on it.
    If you search for transp in the documentation of Graphics, you will find hits for transparency, transparent. drawRGB may be useful, if you really need transparency, without Image-s involved.
    Last edited by wizard_hu_; 2013-11-07 at 10:42.

  3. #3
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: [Help]Transparent fills..

    Hi

    If u r working on Canvas or LCDUI, you can use drawRGB as wizard suggested.

    If you are using LWUIT, you have a direct method to draw a rectangle with alpha channel.

    Create a custom component and in the paint method, set the colour to white with g.setColor(0xFFFFFF) and then draw the rectangle with
    g.fillRect(x, y,width,height, alpha)

    Supply the required amount of transparency in the final parameter.

    alpha = 0 => Fully Transparent
    alpha = 255 => Fully Opaque.

Similar Threads

  1. Transparent bmp
    By samosnokia in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2009-11-21, 09:58
  2. Transparent mode CSD versus non transparent mode
    By mtc95172003 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2009-07-13, 07:23
  3. Replies: 4
    Last Post: 2009-03-16, 09:43
  4. Transparent CSD
    By drkpoon in forum General Development Questions
    Replies: 0
    Last Post: 2003-08-19, 11:06
  5. ListBox in CAknDialog fills up whole dialog
    By Juggle4Evr1 in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-05-16, 10:15

Posting Permissions

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