Background image disappears when the user scroll down

Hello

Here is a class that paints a picture as desktop wallpaper. My problem is that if a vertical scrolling is on the screen, when scrolling down the background image does not scroll also. Is it possible to repeat the background so that it is always on the screen when the user scrolls down.

Thank you.

SerializableAttribute public class BaseVerticalFieldManager extends VerticalFieldManager {}
    
    
public BaseVerticalFieldManager (long style) {}
Super (style);
}

Public Sub paintBackground (Graphics graphics)
{
graphics.drawBitmap (0, 0, Display.getWidth (), Display.getHeight (), Constants.BACKGROUND_IMAGE, 0, 0);

}
    
}

adrianeireyahoo wrote:

Public Sub paintBackground (Graphics graphics)
{
graphics.drawBitmap (0, 0, Display.getWidth (), Display.getHeight (), Constants.BACKGROUND_IMAGE, 0, 0);

}

The values highlighted are wrong - you need to keep track of the Manager scroll position. In addition, using Display.getWidth () and Display.getHeight () isn't exactly smart - use getWidth() / getHeight() Manager itself.

In short, the correct code would be:

    public void paintBackground( Graphics graphics)
    {
        graphics.drawBitmap(getHorizontalScroll(), getVerticalScroll(), getWidth(), getHeight(), Constants.BACKGROUND_IMAGE, 0, 0);
    }

Tags: BlackBerry Developers

Similar Questions

  • In a text box - Guidance Notes that disappears when the user types on?

    Hello

    I'm looking for a way to add Guidance Notes in a text box - that disappears when the user types on?

    Thank you very much

    GD

    See:

    95078.aspx https://Answers.acrobatusers.com/is-Add-Instructional-Text-Text-Field-disappear-clicked-Q1

  • How prevention JButton to actions generated when the user press down

    How prevention JButton to actions generated when the user hold down the key or the short cut
    The code below to show the question when the user keep pressing Alt O
    We want to stop the JButton to generate multi shares just a share only
    A code example shows the behavior that needs to be prevented. Keep pressing "Alt + O" and you will see that the standard ouptput will print the timestamp
    Note Please, I'm NOT interested in the mouse press which is a solution by adding a threshold (setMultiClickThreshhold (long line) on the JButton as an attribute.

     
    public class TestPanel extends JPanel
    {
    
       private JButton btn;
    
       public TestPanel()
       {
          btn = new JButton("Open");
          this.add(btn);
          registerCommand(new MyAction(), InputEvent.ALT_MASK,
                KeyEvent.VK_O, btn, btn.getText(), 0);
       }
    
       public static void registerCommand(AbstractAction action,
             int mask,
             int shortCommand,
             JComponent component,
             String actionName,
             int mnemonicIndex)
       {
          InputMap inputMap = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
          KeyStroke knappKombination = KeyStroke.getKeyStroke(shortCommand, mask);
    
          if ((component instanceof AbstractButton)
                && mnemonicIndex >= 0
                && mnemonicIndex < actionName.length()
                && (shortCommand >= KeyEvent.VK_A && shortCommand <= KeyEvent.VK_Z))
          {
             ((AbstractButton) component).setDisplayedMnemonicIndex(mnemonicIndex);
          }
    
          if (inputMap != null)
          {
             ActionMap actionMap = component.getActionMap();
             inputMap.put(knappKombination, actionName);
             if (actionMap != null)
             {
                actionMap.put(actionName, action);
             }
          }
       }
    
       public static class MyAction extends AbstractAction
       {
    
          /**
           * 
           */
          private static final long serialVersionUID = 1L;
    
          @Override
          public void actionPerformed(ActionEvent e)
          {
             System.out.println(System.currentTimeMillis());
    
          }
    
       }
    
       public static void main(String... args)
       {
          SwingUtilities.invokeLater(new Runnable()
          {
             public void run()
             {
                JFrame frame = new JFrame("Testing");
                JPanel panel = new TestPanel();
                frame.getContentPane().add(panel);
                frame.setPreferredSize(new Dimension(500, 500));
                frame.setMinimumSize(new Dimension(500, 500));
                frame.pack();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setVisible(true);
             }
          });
       }
    
    }
    Published by: user12130673 on 13-feb-2013 03:01

    Use getKeyStroke (int keyCode, int modifiers, boolean onKeyRelease) hit with onKeyRelease = true instead?

  • model background image disappears when I make a new page of the model

    I have a background image in my container in my model.  When I make a new file based on this model, the background image disappears.  No idea why?

    Open your child page in code view.

    Correct the path to your background image manually as described in my previous post.  Record.  Preview in the browser.

    This aid?

    Nancy O.

  • Why my colors and background image disappear when I saw my site?

    When I check the preview I got the warning saying that some files in my being incorrect or missing on the server. I've been using hexadecimal codes for colors, and my background image does not load. The rest of my content loads perfectly well. Help?

    Hello Monicagrace,

    At what stage you get this error?

    When you click Preview with Muse, on file > Site overview in the browser?

    Are you the same error when publish you on BC? To check this you can publish British Colombia by clicking file > publish to Business Catalyst.

    So what is happening locally (preview or preview in the browser page) then I you advise to clear cookies and cache of the browser and then try to preview.

    Kind regards

    Vivek

  • Blue area background behind the button image when the user selects.

    Hi all

    We use images for buttons, we use two images

    When the focus is on another is to unfocus images.

    When the focus moves to the image, the picture showed blue background area behind.

    We would like to remove / delete this blue area behind the image.

    How can do us, please give suggestion / refer to this topic.

    Thank you best regards &,.

    Narendra.

    try to replace drawFocus

  • How to make the master page appear when I'm scrolling down?

    How to make the master page appear when I'm scrolling down?

    This is something I don't like Muse! Whatever it is in the master page will act as a background. You must place it right on the top layer of the Page you want on... I hope this works for you as it did for me!

  • Force the Image to fill the screen when the user resizes the window

    I use flex and actionscript to create a site of photographer and I want the bottom to display an image that completely covers the bottom without distortion.  I tried just an image tag and characterized by the width and height to 100%, but the problem comes when the screen looks wider than the photo.  Thus, the height is reduced to 100% and the width is something less.  I would have rather it evolve according to what is most important, that is, if the window is too wide, the photo with a width of 100% on the scale and let the excess off the screen.  In this way, the photo is still cover the screen and there is no background color of distractrating showing.

    I was counting on the use of actionscript to indicate the width and height of the image so that I can compare it to the height and width of the window, but it seems that you can not get the dimensions of the photo.  I use application.width and application.height, but I need a way to compare it to the photo.  Also, is there an eventlistener that I should use to monitor when the user resizes the window or image resizing will be done automatically?

    Thanks for your comments,

    Tim

    The application container inherit "resize" event of UIComponent.

    Application.application.Width will give you the size of the application in the browser window.

    Thus,.

    function myResizer() {}

    img1. Width = Application.application.width;

    }

  • How to avoid the minimizin of the screen when the user down ups slide

    How to avoid the minimizin of the screen when the user ups the down slide.

    Hello

    I guess that not possible because this is a feature of the system. Be able to substitute the blow to the gesture of bottom up would mean for combat when a user can switch to another application. It is not something that an application must be able to do it at all.

  • Make the text appear in the box when the user clicks on the part of an image

    Is there an easy way to do this in the Muse?

    (1) do different areas of an image map.

    (2) automatically type the letter 'A' in a text box when the user clicks the area 'A' and so on.

    Thank you!

    Essentially, you want a keyboard on the screen? This is not possible with the standard tools of Muse. It would be quite simple with Javascript, however.

    David

    Creative muse

  • How to make the background sound auto replay when the user back to the page?

    Hello. I do a flash project using Adobe Flash CS6 and AS3. Add background sound in every scene. However, I had put a single command to the sound of bg to stop in every scene. But the problem is when the user back to the previous page, the sound does not play. Anyone knows how to wow the background when the user returns without any power button etc.? Thanks in advance!

    var mySound:Sound = new Sound();
    mySound.load (new URLRequest ("sound.mp3"));
    mySound.play ();

  • In Premiere Pro CC 2014, the image disappears when I apply a mask of an effect. Why?

    In Premiere Pro CC 2014, the image disappears when I apply a mask of an effect. Why?

    Too bad...

    Fixed:

    adjustment of projects > switch Renderer.

    Thank you

  • I need to change the background image often when running

    any body help me,.

    I need to change the background image often when running

    concerning

    welcan

    Hello

    You can also use effects rather than a timer, much more enjoyable... following example moves between a series of embedded images.

    David.

    http://gumbo.flashhub.NET/menu/ source included

  • How to display a drop-down menu when the user clicks on a point on lineseries?

    Hi all

    I am new to flex development.

    I watch the series online on the Board, I would like to give a response when the user clicks on the "point" on the line, I want to display a menu drop down and react to the choice of the user on the menu item.

    Is this feasible? Any sample or reference?

    Thanks in advance.

    Jack

    I prefer to use itemClick localX or stageX, according to me, one of these will help you get what you want.

  • Background image stretching across the page footer area

    On a pc with a screen resolution 1280 x 1024 and smaller through IE, when scrolling to the bottom of the background scales image to force down the footer elements appear on the top of the verses of background image on the background color. The background image doesn't repeat from left to right and SHOULD NOT extend to any down. However, it's what happens on the pc. Thanks in advance for the help!
    onmac.jpg
    We'RE MAC - quote at the bottom under the background image and on the bottom. It comes
    be represented correctly.
    onpc.jpg

    We'RE PC - quote at the bottom to the top of the background image - this shouldn't happen

    URL (.. / images/background_alt1.jpg) #5e3718 fixed horizontal left high

    If you remove 'fixed', does that help? I use browser tools and I'm not at home to work directly with Muse. Maybe someone else can give an idea.

Maybe you are looking for