×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    May 2013
    Posts
    272

    How to make textarea component transparent when backgroung image is applied

    I am working on s40 app and created lwuit form. In that form, i m putting one textarea with some content written on it.
    When i apply png image at background of form , i want to make texarea transparent so that image is displayed at the back of textarea.
    I want something like this http://imgur.com/M7szB4c . and slight darkish effect on textarea.
    How to do this

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: How to make textarea component transparent when backgroung image is applied

    i am not sure but try setting textarea->setUID('Label'), that may help you !!

  3. #3
    Registered User
    Join Date
    Dec 2012
    Location
    India
    Posts
    264

    Re: How to make textarea component transparent when backgroung image is applied

    You need to modify this in the theme.For a text area component,Create a rounded border , set the background colour to black and adjust the transparency value to your desire.You should be able to get what you want.

    Here is an article on Rounded Borders which may be of use : http://lwuit.blogspot.in/2008/07/pim...-all-over.html

  4. #4
    Regular Contributor
    Join Date
    May 2013
    Posts
    272

    Re: How to make textarea component transparent when backgroung image is applied

    Thanks.....

  5. #5
    Regular Contributor
    Join Date
    May 2013
    Posts
    272

    Re: How to make textarea component transparent when backgroung image is applied

    Hi i used setUID method on button but it is not working same as textarea. Here is my code
    Code:
     Style style1 = buttondate.getUnselectedStyle();       //BUTTONDATE IS OBJECT OF BUTTON
    		 style1.setBgImage(null);
    		 
    		 style1.setFgColor(0);
    			buttondate.setText("12");
    			 buttondate.setUIID("Lable");
    			
    			buttondate.getStyle().setAlignment(Component.TOP);
    			 buttondate.getPressedStyle().setBorder(null);
    				buttondate.getPressedStyle().setBgTransparency(0);           //EVEN THIS IS NOT WORKING FOR ME
    				//buttondate.setUnselectedStyle(style1);
    		
    		    
    		r = Resources.open("/font.res");             //USED FONT FROM RESOURCE EDITOR 
    		Font myfont=r.getFont("getfont");
    		 buttondate.getUnselectedStyle().setFont(myfont);
    Here when i am applying this to button, button is not behaving as label and backgound of button is giving black.
    How can i get it as a label with transparent background same as i was able to apply on textarea ?
    Last edited by Manpreet_Singh; 2013-09-06 at 05:24.

  6. #6
    Regular Contributor
    Join Date
    May 2013
    Posts
    272

    Re: How to make textarea component transparent when backgroung image is applied

    yes i corrected that , when i am clicking on button the font is displaying very small(in resource editor i made it large) ..and again when picker is opened it is normal. for a fraction of second it displays very small on clicking..what could be the reason

  7. #7
    Registered User
    Join Date
    Dec 2012
    Location
    India
    Posts
    264

    Re: How to make textarea component transparent when backgroung image is applied

    Hi

    The spelling of label is wrong :-)

    buttondate.setUIID("Label");

  8. #8
    Registered User
    Join Date
    Dec 2012
    Location
    India
    Posts
    264

    Re: How to make textarea component transparent when backgroung image is applied

    There are various states that a button goes through, namely pressed,disabled,selected etc..I would suggest you to put the same font for all the different stages.You will not get this problem then.

  9. #9
    Regular Contributor
    Join Date
    May 2013
    Posts
    272

    Re: How to make textarea component transparent when backgroung image is applied

    yes i corrected that , when i am clicking on button the font is displaying very small(in resource editor i made it large) ..and again when picker is opened(on clicking button) it is normal. For a fraction of second it displays very small on clicking..what could be the reason and also when i use swipe gestures on form the text(whose size i increased) written on button disappears
    Last edited by Manpreet_Singh; 2013-09-06 at 06:09.

  10. #10
    Regular Contributor
    Join Date
    May 2013
    Posts
    272

    Re: How to make textarea component transparent when backgroung image is applied

    I am using same theme but getting display as follows http://imgur.com/JrPuEss . I don't want number 9 which is a button to display like that. I want it to show as label which should perform some action .

    But when i m clicking on button ...it is displaying like this http://imgur.com/QuhljXv .


    This is the code i m using in button
    Code:
    		Style bt=buttondate.getUnselectedStyle();
    		
    		buttondate.setText("9");
    		
    		 buttondate.setUIID("Label");
    		
    		 bt.setFgColor(0, true);
    		
    		 buttondate.getPressedStyle().setBorder(null);
    		 buttondate.getStyle().setBgTransparency(0);
    		 buttondate.getUnselectedStyle().setBgTransparency(0);
    	      buttondate.getPressedStyle().setBgTransparency(0);
    		
    		
    		
    			 buttondate.setUnselectedStyle(bt);
    			 buttondate.setSelectedStyle(bt);
    	
    		  Resources r;
    		  System.out.println("lagrge is selected with old");
    		r = Resources.open("/doc.res");
    		Font myfont=r.getFont("stackoff");
    		 buttondate.getUnselectedStyle().setFont(myfont);
    		 buttondate.repaint();
    pLz resolve this issue
    Last edited by Manpreet_Singh; 2013-09-09 at 13:15.

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: How to make textarea component transparent when backgroung image is applied

    It may work better to create a single block of buttondate.getStyle().setXY calls, and duplicate it for the various states. When it works, you can start thinking about simplifying the code, checking if a single Style object could be re-used, etc.

Similar Threads

  1. Backgroung Image and controls
    By cholker in forum Symbian User Interface
    Replies: 13
    Last Post: 2012-02-27, 11:39
  2. BackGroung Image of List in J2me
    By rana.anees in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2012-02-20, 14:41
  3. How to make transparent image
    By somnathbanik in forum Symbian
    Replies: 21
    Last Post: 2010-08-07, 11:32
  4. Drawing backgroung image in the listbox
    By kariwalasameer in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-10-20, 08:51
  5. Backgroung Image for Dialog
    By engrsanjiv in forum Symbian User Interface
    Replies: 0
    Last Post: 2002-09-04, 13:19

Posting Permissions

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