Background image with scrolling not for the screen

Hi all.

I use the following code to make the background dropdown not image, and it works for all BlackBerry Storm2 (OS 5.0) except (I tried it on a simulator):

public class MyScreen extends MainScreen{

...

    public MyScreen() {
       super(NO_VERTICAL_SCROLL);
       bitmap=loadBG();       super.add(mContainer = new BGVerticalFieldManager(bitmap));
    }
    public void add(Field field){        mContainer.add(field);    }...

}
public class BGVerticalFieldManager extends VerticalFieldManager {
    Bitmap mBgBitmap = null;
    int mBgWidth = -1;
    int mBgHeight = -1;
    int mBgX = -1;
    int mBgY = -1;

    public BGVerticalFieldManager(Bitmap background) {
        super(USE_ALL_WIDTH | USE_ALL_HEIGHT | VERTICAL_SCROLL
                | VERTICAL_SCROLLBAR);
        mBgBitmap = background;
        mBgWidth = mBgBitmap.getWidth();
        mBgHeight = mBgBitmap.getHeight();
        mBgX = (Display.getWidth() - mBgWidth) >> 1;
        mBgY = (Display.getHeight() - mBgHeight) >> 1;

    }

    protected void paintBackground(Graphics graphics) {
        paintBackgroundBitmap(graphics);
    }

    protected void sublayout(int maxWidth, int maxHeight) {
        mBgX = (Display.getWidth() - mBgWidth) >> 1;
        mBgY = (Display.getHeight() - mBgHeight) >> 1;
        super.sublayout(maxWidth, maxHeight);
    }

    private void paintBackgroundBitmap(Graphics graphics) {
        if (null != mBgBitmap) {
            int x = mBgX
                    + getHorizontalScroll();
            int y = mBgY
                    + getVerticalScroll();
            graphics.drawBitmap(x, y, mBgWidth, mBgHeight, mBgBitmap, 0, 0);
        }
    }

}

The Storm2 scrolls the background image, looks that getVerticallScroll() does not work.

Can someone help me with this?

Thank you.

also have glance at this:

http://supportforums.BlackBerry.com/T5/Java-development/use-a-background-image-in-application-screen...

Tags: BlackBerry Developers

Similar Questions

  • How to set a background image re-scalable depending on the screen resolution of viewers

    Hello

    I searched the net for ages looking for a way to make a background image on the scale according to the size of a monitor of viewers.

    I found a solution:

    Source code

    < body >

    "< img src ="... /... ' / Images/Connor/background_bg.png ' class = 'bg' >

    < / body >

    CSS (style)

    {img.BG}

    / * Define the rules to fill the background * /.

    min-height: 100%;

    min-width: 1024px;

    / * Set up a proportional scaling * /.

    Width: 100%;

    height: auto;

    / * Set up positioning * /.

    position: fixed;

    top: 0;

    left: 0;

    }

    @media screen and (max-width: 1024px) {}

    {img.BG}

    left: 50%;

    left margin:-512px. }

    }

    Now, this has the desired effect, however when I place a div below "< img src ="... /... "' / Images/Connor/background_bg.png ' class = 'bg' > ' in the body of my site, it pushes this div below my bottom.

    I got the code from " " http://CSS-tricks.com/perfect-full-page-background-image/ "and it does not seem to do this in this example. "

    I pasted my complete code below, if someone could have a look and advise where I'm wrong that would be greatly appreciated.

    Thanks and greetings

    Elliot

    Source code

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    < title > Untitled Document < /title >

    < link href = "style.css" rel = "stylesheet" type = "text/css" / > "

    < script type = "text/javascript" >

    function MM_swapImgRestore() //v3.0 {}

    var i, x = offline. MM_sr; for (i = 0; a & & I <.) Length & & (x = a [i]) & & x.oSrc; i ++) x.src = x.oSrc;

    }

    function MM_preloadImages() {//v3.0

    var d = document; If (d.images) {if(!d.MM_p) d.MM_p = new Array();

    var i, j is d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i <.) Length; i ++)

    If (a [i].indexOf("#")! = 0) {d.MM_p [j] = new Image; d.MM_p [j ++] .src = a [i] ;}}

    }

    function MM_findObj (n, d) {//v4.01

    var p, i, x;  if(!d) d = document; If ((p = n.IndexOf ("?")) > 0 & & parent.frames.length) {}

    d = parent.frames [n.Substring(p+1)] .document; n = n.Substring (0, p) ;}

    If (!) () x = d [n]) & & copyrights) x = d.all [n]; for (i = 0;! x & & i < d.forms.length; i ++) x = d.forms [i] [n];

    for (i = 0;! x & & d.layers & & I < d.layers.length; i ++) x = MM_findObj (n, d.layers [i] .document);

    If (! x & & d.getElementById) x = d.getElementById (n); Return x;

    }

    function MM_swapImage() {//v3.0

    var i, j = 0, x, a = MM_swapImage.arguments; document. MM_sr = new Array; for (i = 0; i <(a.length-2); I += 3).

    If ((x = MM_findObj (a [i]))! = null) {document. MM_sr [j ++] = x; if(!x.oSrc) x.oSrc = x.src; x.SRC = a [i + 2] ;}

    }

    < /script >

    < / head >

    < onload of the body = MM_preloadImages('..) « /.. / Images/Connor/nav_bar/home_ro.png ','... /... / Av_bar/about_me_ro.png images/Connor/n ','... /... / Images/Connor/nav_bar/c.v_ro.png ','... /... / Bar/portfolio_ro.png images/Connor/nav_ ','... /... (/ Images/Connor/nav_bar/contact_me_ro.png') ">"

    "< img src ="... /... ' / Images/Connor/background_bg.png ' class = 'bg' >

    < div id = "web_centre_wrap" >

    < div id = 'menu_bar' > < table width = "960" border = "0" cellspacing = "0" cellpadding = "0" >

    < b >

    "< td width ="105"height ="68"> < img src ="... /... "/ Images/Connor/nav_bar/nav_bar_left.png" width = "105" height = "68" / > < table >

    "< td width ="147"height ="68"> < a href =" # "MM_swapImgRestore" onmouseover = "MM_swapImage ('Image3 '", '... /..) " (/ Images/Connor/nav_bar/home_ro.png',1) "> < img src ="... /... "/ Images/Connor/nav_bar/home.png" name = "3" width = "147" height = "68" border = "0" id = "3" / > < /a > < table >

    "< td width ="147"height ="68"> < a href =" # "MM_swapImgRestore" onmouseover = "MM_swapImage ('Image4 '", '... /..) " (/ Images/Connor/nav_bar/about_me_ro.png',1) "> < img src ="... /... "/ Images/Connor/nav_bar/about_me.png" name = "Image.4" width = "147" height = "68" border = "0" id = "Image.4" / > < /a > < table >

    "< td width ="148"height ="68"> < a href =" # "MM_swapImgRestore" onmouseover = "MM_swapImage (' picture5 '", '... /..) " (/ Images/Connor/nav_bar/c.v_ro.png',1) "> < img src ="... /... "/ Images/Connor/nav_bar/c.v.png" name = "Picture5" width = "148" height = "68" border = "0" id = "Picture5" / > < /a > < table >

    "< td width ="147"height ="68"> < a href =" # "MM_swapImgRestore" onmouseover = "MM_swapImage ('Image6 '", '... /..) " (/ Images/Connor/nav_bar/portfolio_ro.png',1) "> < img src ="... /... "/ Images/Connor/nav_bar/portfolio.png" name = "Image6" width = "147" height = "68" border = "0" id = "Image6" / > < /a > < table >

    "< td width ="148"height ="68"> < a href =" # "MM_swapImgRestore" onmouseover = "MM_swapImage ('Image7 '", '..) " /.. (/ Images/Connor/nav_bar/contact_me_ro.png',1) "> < img src ="... /... "/ Images/Connor/nav_bar/contact_me.png" name = "Image7" width = "148" height = "68" border = "0" id = "Image7" / > < /a > < table >

    "< td width ="118"height ="68"> < img src ="... /... "/ Images/Connor/nav_bar/nav_bar_right.png" width = "118" height = "68" / > < table >

    < /tr >

    < /table >

    < / div >

    < div id = "header" > < / div >

    < div id = "content" > < / div >

    < div id = "footer" > < / div >

    < / div >

    < / body >

    < / html >

    CSS (style)

    @charset "utf-8";

    / * CSS document * /.

    {img.BG}

    min-height: 100%;

    min-width: 1024px;

    Width: 100%;

    height: auto;

    position: fixed;

    top: 0;

    left: 0 ;}

    @media screen and (max-width: 1024px) {}

    {img.BG}

    left: 50%;

    left margin:-512px ;}

    {#web_centre_wrap}

    Auto margin: 0 ;}

    {#menu_bar}

    #header {}

    Background: url (.. /.. Images/Connor/Header.png) ;}

    #content {}

    Background: url (.. /.. Images/Connor/content.png) ;}

    #footer {}

    Background: url (.. /.. Images/Connor/footer.png) ;}

    Try this:

    http://ALT-Web.com/test/resizable-BG.shtml

    Nancy O.

    ALT-Web Design & Publishing

    Web | Graphics | Print | Media specialists

    http://ALT-Web.com/


  • my information does not match the screen. I have to scroll sideways and vertically for all to see

    my information does not match the screen.  I have to scroll sideways and vertically for all to see

    How can I change the size if it is adapted to the screen?

    Hi Marilyndunn,

    ·         are what application you referring?

    ·         It occurs on all applications?

    ·         If it works well before?

    ·         Did you do changes on the computer before the show?

    You can see the following article for more information about the display settings.

    Get the best display on your monitor

    http://Windows.Microsoft.com/en-us/Windows-Vista/getting-the-best-display-on-your-monitor

     

    Make the computer easier to see (optimize visual display)

    http://Windows.Microsoft.com/en-us/Windows-Vista/make-the-computer-easier-to-see-optimize-visual-display

    Hope this information helps.

  • I have a logo on a white background.  I need the bottom either transparent.  Not for the life of me I remember how to do this.  Could someone help me with this, please?  Thank you

    I have a logo on a white background.  I need the bottom either transparent.  Not for the life of me I remember how to do this.  Could someone help me with this, please?

    Elimination of the background is transparent can be done with precision using the mixture control if the Style layer.

    1. open the file and if the layer is locked, trash the lock.

    2 Cmd + click on the new icon layer in the layers panel to apply a layer of vacuum below the object.

    3. return to the upper layer and double-click it in the layers panel to bring up the layer Style.

    4 in section mixture if at the bottom of layer Style, move the high gray-scale slider to the right page to the left until it disappears from the background of the illustration. For extra precision, to the point where the White is about to disappear, you can click Option on the half left of the cursor to divide and move it gently to the left when you look white in the picture disappear.

    5. layer > merge down and then file > save

  • Can you please provide me with the part number for the screen for model #: NX. SHKAA.001?

    Can you please provide me with the part number for the screen for model #: NX. SHKAA.001 (AO1 - 131 M-C1T4)?  The first ten digits of the serial number are NXSHKAA005.

    Matt or gloss is what it looks like. Some like not brilliant but because most are a reflection. I would say that they would work as long as the resolution of the size and the backlight are the same.

  • all the pages that load do not match the screen have to scroll on the side to side to read

    all the pages that load do not match the screen have to scroll on the side to side to read

    all the pages that load do not match the screen have to scroll on the side to side to read

    =================================
    Try the following...

    View / Zoom... reduce the percentage

    The Zoom option can also be accessed from
    your at the bottom status bar.

    John Inzer - MS - MVP - Digital Media Experience - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - to proceed at your own risk

  • Need help to open two images with the same file with different exposures on the screen at the same time in the Photoshop creative cloud (in previous versions we could open two images of the same nef (raw) file and then combine them on the screen with the

    Need help to open two images with the same file with different exposures on the screen at the same time in the Photoshop creative cloud (in previous versions we could open two images of the same nef (raw) file and then combine them on the screen with the move tool. They have become a composite of two layers which could be developed further with the mask tool.

    Hello

    Please go to the preferences > workspace and uncheck the option 'open the document in the tabs '.

    Now you can click on file and choose file > open and open the two images in two different windows which can be arranged side by side.

    Thank you

  • Muse automatically optimizes the images that you download for the background on your site?

    Muse automatically optimizes the images that you download for the background on your site?

    Oh, thanks a lot for this. Do you know what the height and width

    increments are for Muse? It is said in my page attributes that the height is

    660 and the width is 960. How does that translate in Photoshop?

    Amy

  • HP 15 ba-015na with Windows 10: Customizing the screen saver

    Hi, I would like to customize the screensaver of my brand new HP 15 ba-015na that came with Windows 10.

    Problem is when I go to the screen saver settings all I have is the screen savers (no more six screensavers of Win10) and the selection button is not highlighted. I tried the mwnu of customization, but there is nothing that I see that would help. OD did I miss something?

    Screen saver of my laptop Toshiba Satellite old made default to the photos on the laptop and they arose at random, which is what I would have on my new HP.

    Grateful for any help. TIA.

    Hello

    You can do the following.

    Right-click on an empty area of the desktop and select Personalize.

    In the next window, select the screen lock in the left pane, then scroll and select the screen saver settings.

    In the next window, select Photos in the menu drop-down, then click on apply to save the change.

    If you want to change the location of the images are selected, click on the button to the right of the drop down - menu parameters here, you can also select the slideshow speed or activate random playback.

    Kind regards

    DP - K

  • Newbie: background image with overlay problems

    I use a large background image with several circles superimposed over the image. When the image is resized to different browser screens, overlays remain unchanged, even if the changes of background image to fit the browser. As a result, overlays eventually his place with respect to the substantive parts and cover image, I don't want to not covered. Clearly, I'm a newbie with dreamweaver. Useful links?

    Mark

    This approach to layout does not work in flow layout (%).   APDivs are removed from the normal document flow and thus remain absolutely where you positioned them.

    Cards images do work either in fluid layouts.  As the picture re-sizes to fit the display window, the hotspot regions are not.

    When you create responsive Layouts, review your Mobile implementation objectives first.  Then tablets and desktop computers.  And above all, to keep things simple.

    Responsive Web Design

    http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-Web-design/

    Introduction to CSS Media Queries

    http://www.Adobe.com/devnet/Dreamweaver/articles/introducing-media-queries.html

    Nancy O.

  • Icons become very large and do not match the screen

    My screen keeps going wonky and the image becomes too large for the iPad mini.  I continue to turn it off, and sometimes it returns to normal.  How can I stop this from happening?

    If the screen with zoom in try double-clicking the screen with 3 fingers and see if what he zoomed back - and if it does not define the settings > general > accessibility > Zoom "off". If there isn't a zoom you back off then try triple-click the home button and see if it it shuts off, and if it isn't you can then change what a triple-click via the settings > general > accessibility > accessibility shortcut (or Triple-click home if it is on an older version of iOS).

  • Export options for the screen display?

    I want to do a screening to export a lot of photos that will be visible on the phones, tablets, and TVs.

    1. is the best sRGB color for the on-screen display space?

    2. I'm culture images in 16 x 9. All the megapixels in these pictures are wasted for the display? I'll change the resolution to 72, well that what should I do with the megapixels?

    Thank you.

    It was not the case for a long time.

    A pixel is a pixel. 2000 pixels will be 2000 pixels to display. the question is that of the device. The native resolution of a in 20 Apple Cinema Display is 1680 x 1040 so a 2000 pixel wide image will be too large for the screen at 100%

    On the other hand, the iMac 5K has 5120 x 2880 the same 2000 pixel image would take less than half of the screen.

    The 'thumb' of 72 240 or 300 resolution concerns only thumbs on a sheet of paper, not a screen.

  • Try a background image with a PNG with transparency matte / partial transparency

    Hello everyone.

    Here's the scenario;

    1. I have a PNG sequence rendered in a 3d program. The sequence has a landscape that is partially transparent and has no background image or color. In the animation, which is not the landscape is 100% transparent, while the landscape is partially transparent.
    2. I have a background that I want to put behind the PNG sequence but I don't want the background visible through the part of the landscape of the sequence, only the portion that is 100% transparent.

    I tried several different methods, but because the landscape is partially transparent, with a matte (alpha or alpha reverse) or blend (such as stencil alpha) mode does not give me the results I'm looking for.

    I'm looking for is a way of mast (or mask) the background image with only the part of the PNG that is 100% transparent. In this way, the background image are not displayed in the semi transparent landscape, but will be visible in the part that is 100% transparent.

    I would like to find a reasonable solution in After Effects, as opposed to the sequence of 3d objects rendered being invisible to the camera and the current background. The landscape scene itself took a considerable amount of time to make (120 hours) and I would like to avoid this kind of delay in my project.

    Thank you all in advance for your consideration.

    Maybe I said incorrectly: you cannot use the 3D app to generate a matte black and white simple - or mattes - to separate properly, then just composite in AE?

  • How can I force an image to open completely on the screen in action?

    In PS CS5 when I open an image with height in the range of 1405-1411 or 1873-1882, the image opens half of the bottom of the screen.  Width opts seem to matter.

    I guess it's a bug, but until it is fixed, I'm trying to work around.

    For manual fitting the vertical adjustment button or zoom out screen causes the image to the screen lights up but neither of these options will save in an action to display.

    When an image is opened halfway off the screen, Place a command place precisely for these images.  So an action that includes a place does not work for these images.

    So either I want to find an arrangement (Nothing in preferences that I can find) to force the image open to the screen, or find a command that runs in an action that activates the picture to come on the screen, while not interefering with images that open normally.

    You can use Insert a Menu item (the Launcher to the Panel menu actions) to record something like view > fit to the screen, but what you describe should not be the case.

    You are using tabs or floating documents?

    Have you tried resetting preferences cs5?

    http://forums.Adobe.com/thread/375776?TSTART=0

    Maybe you could post a screenshot showing how the image opens.

  • iMac (21.5 inch, mid 2011) programs do not fill the screen

    My windows does not fill the screen, as in there is a small strip at the bottom of my screen which is my desktop wallpaper (screenshot of control to the footer of this website) any application that I use, I still see a bunch of my wallpaper down. I love being able to see my toolbar I have a few apps running for the supervision of different things, which is why I do not enter the mode full screen as it hides everything. Is there a solution to this? I can drag the window down a little and then stretch her so it fills the screen, but a simple refresh my browser or a change in the program, it will break again with the small bar at the bottom again.

    Please post a screenshot of the page complete so we can see what you're referring to.

Maybe you are looking for

  • My Emachines E525 freezes frequently.

    I have acer emachines E525. It keeps stuck a lot. The system stops working and after a few minutes, it will return to normal. Especially, sometimes while I use the browser. What should I do?

  • Help driver for computer laptop 14z-b000.

    I recently bought the laptop 14z-b000. Problem is that I don't no the link windows 8 and installed windows 7 64-bit. Although I was able to install most of the drivers, Miss me some of them. Ethernet controller USB controller As they don't seem to be

  • DELL CUSTOMER SERVICE DECLINED TO SET VIDEO_TDR_FAILURE

    I called customer service to ask questions on potentially to replace my laptop (new) due to recurring BSOD due to errors such as 'video_tdr_error' and 'video_scheduler_internal_error '. I have tried all possible troubleshooting technical or fix sugge

  • Remove the big black bar at the top and bottom of Office

    original title: my desktop image now has a big black bar at the top and bottom. How can I get rid of this? The image filled my monitor yesterday. Today, I have a big black bar at the top and bottom. How can I get rid of this?

  • Animated GIF problem

    Hello I use a GIF image for the design of the loading bar The image is a black & white gif image that is his black image with white animation on it. but the problem is when I tried to load the image in the encodedImage holding corruption when shading