×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    9

    eSWT - Image on a button

    Hi all,

    I'm trying to add an image to a button (eSWT Button).
    The image is corectly added to the button but the rest of the button which is not covered by the image is visible to the user.
    Is there a way to have only the image visible?

    The code I'm using is the following:
    Code:
    		    myButton = new Button(this, SWT.PUSH);
    		    myButton.setImage(new Image(display, MyClass.class.getResourceAsStream("/icons/test.png")));
    Thank you for your time!

  2. #2
    Nokia Developer Expert
    Join Date
    Nov 2008
    Posts
    72

    Re: eSWT - Image on a button

    SWT.FLAT style may help a little but there is no real way to get rid of the margins around the Button.
    --
    Gorkem

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    9

    Re: eSWT - Image on a button

    Thanx for your reply Gorkem although it didn't help me a lot!

    So.. if I want to have an image added to a button and only the image to be visible.. is it possible to realise it or not??

    If not, can you please tell me how can I wrap a button label in a button? (Right now when I have longer text than the button size, the text is just showing till the edge of the button).

    Looking forward to your replies!!

Similar Threads

  1. Image to byte[] (without getRGB)
    By lospatzos in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2009-07-28, 17:46
  2. problem in display an image button on canvas(Background image)
    By mramin05 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2008-11-12, 04:51
  3. --- ???save image problem??? ---
    By ferenn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2007-10-01, 14:33
  4. image imn button
    By introuble in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-07-20, 18:49
  5. Loading Image data from 'raw' bytes
    By LongSteve in forum Mobile Java General
    Replies: 2
    Last Post: 2002-11-20, 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
  •