Gradient background of a screen.

Hi all,
 If anybody have managed to implement gradient background color of a screen?
 There is one example in Developers Knowledge Base how to change the background color of a screen. It is working fine for me but if I use
         int[] X_PTS = { 0, 0, width, width};       
         int[] Y_PTS = { 0, height, height, 0 };       
         int[] drawColors = { 0x0000CC, 0x0000CC, 0xCC0000, 0xCC0000 };       
         try {           
             g.drawShadedFilledPath(X_PTS, Y_PTS, null, drawColors, null);       
         } catch (IllegalArgumentException iae) {
            System.out.println("Bad arguments.");
 instead of g.setBackgroundColor(Blue_color);
does not work for me.
 Any idea?
 Is there is just one way to rewrite the paint() for fields on top of screen as well?
 Thank you for help in advance.

I just saw your post.
I hope by now you might have found an answer... but if someone else stumbles upon, here is the solution:
public void paint(Graphics graphics) {
//Variables for drawing the gradient
int[] X_PTS_MAIN = { 0, Display.getWidth(), Display.getWidth(), 0};
int[] Y_PTS_MAIN = { 0, 0, Display.getHeight(), Display.getHeight()};
int[] drawColors_MAIN = { backgroundColor, backgroundColor, backgroundShadingColor, backgroundShadingColor};
try {
//Draw the gradients
graphics.drawShadedFilledPath(X_PTS_MAIN, Y_PTS_MAIN, null, drawColors_MAIN, null);
} catch (IllegalArgumentException iae) {
System.out.println("Bad arguments.");
super.paint(graphics);
Please marked as solved, if that is what you were after,.

Similar Messages

  • How can i use this color for my Application Background ?? Screen Shot Attached

    Hi ,
    I can find only plain colors on to Color Picker , but this is line mixed color
    How can use this attached Color for my Applications Background Color .
    Please find the Screen Shot attached .
    please see the background  color

    Are you trying to apply a gradient background?
    In Flex 3 in Application tag:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      backgroundColor="#666666"
      backgroundGradientColors="[#333333, #666666]">
    </mx:Application>
    In Flex 4 you need to set the backgroundColor and apply a skin for the gradient:
    -------------- mySkins/MyAppSkin.mxml -------------
    <?xml version="1.0" encoding="utf-8"?>
    <!-- containers\application\mySkins\MyAppSkin.mxml -->
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:mx="library://ns.adobe.com/flex/mx"
            xmlns:s="library://ns.adobe.com/flex/spark">
      <fx:Metadata>
        [HostComponent("spark.components.Application")]
      </fx:Metadata>
      <s:states>
        <s:State name="normal" />
        <s:State name="disabled" />
      </s:states>
      <!-- fill -->
      <s:Rect id="backgroundRect" left="0" right="0" top="0" bottom="0">
        <s:fill>
          <s:LinearGradient rotation="90">
            <s:entries>
              <s:GradientEntry color="0x333333" ratio="0" alpha="1"/>
              <s:GradientEntry color="0x666666" ratio=".66" alpha="1"/>
            </s:entries>
          </s:LinearGradient>      
        </s:fill>
      </s:Rect>
      <s:Group id="contentGroup" left="10" right="10" top="10" bottom="10">
        <s:layout>
          <s:VerticalLayout/>
        </s:layout>
      </s:Group> 
    </s:Skin>
    -------------- test.mxml -------------
    <?xml version="1.0"?>
    <!-- controls\button\PopUpButtonMenu.mxml -->
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   height="100%" width="100%">
      <s:SkinnableContainer skinClass="mySkins.MyAppSkin"
        width="100%" height="100%"/>
    </s:Application>
    If this post answers your question or helps, please mark it as such. Thanks!
    http://www.chikaradev.com
    Adobe Flex Development and Support Services

  • Restrict 'Executing report in background' from selection screen

    I want user to not to select option for executing report in background from Selection Screen of the program.
    i.e. 'Execute Program in Background' option in 1st menu bar tab should either be disabled OR if user clicks on it then he should get error message on selection screen itself.
    Thanks,
    Falguni

    Hi Falguni,
    Write the code based on function code SJOB in the event AT SELECTION-SCREEN. Write the following code :
    AT SELECTION-SCREEN
    CASE SY-UCOMM.
    WHEN 'SJOB'.
    MESSAGE E000 WITH 'You cannot schedule background job'.
    ENDCASE.
    Thanks & Regards,
    Faheem.

  • How do you make a gradient background on a button in flex 4

    Hey everyone, this is driving me crazy. Below is my css for a button in file.  I want a gradient background on a button in flex 4. I can not for the life of me figure out how to do this. There is no longer the backgroundColors option. chromeColor is only a single color and all the examples I see on the web using fill, and linearGradient throw up errors so I assume these were only in the beta? This is very frustrating to not be able to do a simple thing in flex 4 that worked in flex 3. Any ideas? Thanks.
    Button {
    cornerRadius: 3;
    highlightAlphas: 0.36, 0;
    fillAlphas: 1, 1, 1, 1;
    paddingLeft: 5;
    paddingRight: 5;
    backgroundColors: #ff6600, #ff9900, #ffffff, #eeeeee;
    color: #ffffff;
    disabledColor: black;
    textRollOverColor: #000000;
    textSelectedColor: #000000;
    borderColor: #ff6600;
    fontWeight: normal;

    This may not be what you're looking for, but since you are stuck, I'll elaborate on what FTQuest was saying. It will only take a few minutes to do this.
    In FB4:
    1. right-click the button, choose "Create Skin", give it a package (directory) and name (filename), host component "spark.components.Button" and "Create as copy of" "spark.skins.spark.ButtonSkin".
    This creates junk.mxml for you, the skin file.
    2. In the source of junk.mxml, change layer 1 (shadow) and layer 2 (fill) colors as I did here in this code. Note that where you see {color#}, this is data-binding to a variable I've made in a color.as file that I've included in the skin file. In fact, that is ALL that I changed in the skin file it generated for me.
    snippet from colors.as:
    public   var color1:int = new int(0xA1D190);
    snippet from junk.mxml:
    <![CDATA[
    include "Colors.as";
    layer changes in junk.mxml:
    <!-- layer 1: shadow -->
    <!--- @private -->
    <s:Rect id="shadow" left="-1" right="-1" top="-1" bottom="-1" radiusX="2">
    <s:fill>
    <s:LinearGradient rotation="90">
    <s:GradientEntry color="0x000000" color.down="
    {color5}"alpha="
    0.01"alpha.down="
    0" />
    <s:GradientEntry color="0x000000" color.down="
    {color6}" alpha="
    0.07"alpha.down="
    0.5" />
    </s:LinearGradient>
    </s:fill>
    </s:Rect>
    <!-- layer 2: fill -->
    <!--- @private -->
    <s:Rect id="fill" left="1" right="1" top="1" bottom="1" radiusX="2">
    <s:fill>
    <s:LinearGradient rotation="90">
    <s:GradientEntry color="{color2}" color.over="
    {color3}" color.down="
    {color4}" alpha="
    0.85" />
    <s:GradientEntry color="{color4}" color.over="
    {color5}" color.down="
    {color6}" alpha="
    0.85" />
    </s:LinearGradient>
    </s:fill>
    </s:Rect>
    You can (and maybe should) hardcode colors in here to do your gradients. After this, your button will need to use the skin, like:
    <s:Button ... skinClass="Skins.junk">
    ... where "Skins" is the name of the package/directory I told it to create the skin in.
    This may not be ideal for you, but it's working for me. Regarding having variables for color values, I posted a thread this morning asking if this is the best way to do things or not, so I don't know if it's the way to go.
    Hope this helps ... 

  • Problem with Gradient Background

    When I publish my code for the gradient background and view
    it on the web I generate a 15 pixel gap between the stage and the
    tab bar on Firefox. So when viewed you see the tab bar, then the
    default color for the stage background, and then the gradient stage
    background. How do I get rid of the gap?
    To view the effect please go to
    www.arealtaxcut.com/index000.html --- Here is the code:
    I did add the HTML tags <center> </center> to the
    .html file.

    css call in the body tag: <body margin="0"> worked to
    bring the entire document to the left, however there was still the
    issue of the spacing at the top. After further research this is
    what I came up with and it works like a charm.
    <style type="text/css"><!--body {margin:0px;
    padding:0px;}--></style>
    Rob Dillion thank you for (1) your quick response and (2) for
    pointing me in the right direction. Very helpful.

  • Gradient Background problems

    I have Enterprise version 8.1 installed on my machine and I am using it to reverse engineer some Java code. I would like to generate a few graphics in eps format, and I am having serious problems with the size when I export them as svg and translate them to eps. So, I want to turn off some of the background gradients, etc.
    When I go to the UML Advanced options and enter the "Set Glocal Colors and Fonts" I can change the "packagelightgradientfill" and "BackgroundColor" to white from the lime green color (for example on a deployment diagram. If i click on OK or apply, I get a message asking if I want to change the other items. After about 10 second, the colors revert back to their normal green values. Is this something wrong with my installation?

    Your installation is fine, the capability to change gradient background was not implemented in 8.1. If you try the UML module in NB6.0 (currently in Milestone 9) you will be able to simply turn on/off gradient for all elements, Advanced options -> UML -> Diagrams -> Gradient Background. The gradient start / stop color is still not customizable.

  • My ipad froze with my camera screen on and my background on full screen?  If I press any button it takes a picture

    my ipad froze with my camera screen on and my background on full screen.  Every button I push on
    it takes a pic.  won't shut off either, it takes a pic instead

    First try a Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least Ten seconds... (But can take Longer)... until the Apple logo appears. Release the Buttons
    If no joy... Try a Restore...
    1: Connect the device to Your computer and open iTunes.
    2: If the device appears in iTunes, select and click Restore on the Summary pane.
    Restoring  >  http://support.apple.com/kb/HT1414

  • I want the black background in full-screen

    I liked the old black background in full-screen option in Pages. Is there a way to get that back?

    Blackboard paint on your screen?
    Part of the new, improved, simpler way to do things in Pages 5.
    Menu > Pages > Provide Pages Feedback
    Peter

  • Gradient background not aligned correctly

    i have some photo pages and the gradient background is not aligned correctly
    - generally below where I want it - like on iweb shows correctly - but on web - it is below the navbar.....
    .... how do I control this?
    is this something to do with layout? one page is fine - the next is messed up....
    this was an import from iweb 2006 - does that matter

    crazy enough but I think I found it : I had a 3 word title for the page - and when I replaced the spaces with dashes - the problem went away.....
    Is that kooky or what?

  • [Solved] Change default leaf background when unlocking screen in Gnome

    This is kinda silly, but how do I change the default desktop background when unlocking screen in gnome?, its always that annoying green leaf background, how can I make it my wallpaper instead?
    Last edited by daf666 (2009-06-13 12:35:29)

    See the Gnome_Tips wiki article which contains the answer to this and other questions
    Change the Default Background Image
    The default background is that zoomed in picture of a green leaf. It appears for newly created users, but more importantly, this is the image shown when the screen is locked. As of 25-Apr-2009, you can find this image here
    /usr/share/pixmaps/backgrounds/gnome/background-default.jpg
    To change it, simply copy your favorite image to this locate (as root) and rename it.

  • How to provide background color to screen elements in screen designing?

    Hi all
        I am preparing a screen in module pool programming.
        I created 1 screen in that.
        How can i provide colors or background colors to my screen elements on that screen.
        Is this facility is there?
        If any body knows this please reply to this.
    Regards,
    K.S.L.Neelima.

    Hello
    I don't think it is posible... change the colour of screen element but you can only change the background color of screen but you can not put any elemnet on that screen using  picture control check for program RSDEMO_PICTURE_CONTROL will help you.

  • To color background of a screen and border them.

    Hi Experts,
    Need to color the background of a screen , can this be done without object oriented programming...need to border them also...
    Thanx.

    Hi ,
    Plz correct me if I am wrong....that waz used to color a table rite...can it be used in order to color the background of a screen...
    Thanx,
    Sunitha

  • JFreeChart Help:  Creating a Gradient Background for a CategoryPlot

    I need a Gradient Background for my CategoryPlot Object and am having problems figuring out the best approach.
    Does anyone have any suggestions on the best way to approach this problem?
    Any help would be appreciated.

            BarRenderer barrenderer = (BarRenderer)categoryplot.getRenderer();
            barrenderer.setDrawBarOutline(false);
            GradientPaint gradientpaint = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, new Color(0, 0, 64));
            GradientPaint gradientpaint1 = new GradientPaint(0.0F, 0.0F, Color.green, 0.0F, 0.0F, new Color(0, 64, 0));
            barrenderer.setSeriesPaint(0, gradientpaint);
            barrenderer.setSeriesPaint(1, gradientpaint1);

  • Add a texture to a gradient background

    I have a web mock-up with a gradient background.  This is just a rectangle with a gradient fill at the bottom layer.  I would like to add a texture to my background.  Just some noise or a parchement or something.  I don't know how to do it.  I would like the texture to have the colour of the background of course and be fairly indistinct.
    Could you just give me a few pointers please
    Thanks
    Martin

    Many thanks
    That's it.
    I think I was trying to approach it in a Photoshoppy kind of way.  Strkes me this was a bit easier than how I would have done it in PS.
    Anyway, I'm another couple of degrees up that learning curve!
    Regards
    Martin

  • I Need Help With Gradient Backgrounds

    Can someone explain to me why my design appears as if it has an outer glow when I add a gradient background? Thanks in advance.

    Sorry, nothing to recognize, I don't see on the pixel "accident" what you mean.
    Make the sreen shot with the OS, not with a camera.
    Show in detail what your problem is.
    Tell us: OS, version, what have you done, file type, etc.
    As it is now we can't see anything important.

Maybe you are looking for

  • ADF Master Detail entry form issue

    Hi All, I am new to JDeveloper and I am creating a Master Detail entry form. I have separate buttons to create master records and detail records in Master and Detail sections respectively. After completing data entry in Master portion, when I hit the

  • Workflow with Release Strategy for PR & PO

    Hi Experts, I have configured the PR & PO Release strategy and it is working fine. My client wants the Workflow concept in Releases. So User should get the information about the releases for PR & PO. But I don't have much idea on Workflow, how it wor

  • MAC QUESTION--I'm looking for the toggle button for thumbnails

    MAC QUESTION--I'm looking for the toggle button that use to be on the bottom right of desktop folders to increase and decrease the size of the thumbnails.  Does this still exist?

  • Oracle CM SDK Queries

    1. When a word document is edited in Webstarter Application UI, it opens the document in IE and when saved, saves it in the local machine. So, a) How can we open the documents in the appropriate application at the client? b) How can we program such t

  • Try n chk ur n8

    hello guyz if u want to chk the display of n8 do this ,u will find display is working fine or not,First of all go to dark room, go to setting and then in screen saver put none ,now lock the phone send sms frm another phone to ur n8 dont open the lock