Implement the bitmap scaling as a backdrop for MainScree

Newbie here. Well, I know that there's much out there on what I just spent the largest part of this holiday weekend trying to achieve. Here's what I'm trying to do:

1. I have a bitmap png file that is large enough to accommodate the larger size of the screen.

2. I need the title bar on a screen.

3 I need bitmap scaling down to adjust the device existing rest area non-defilement as a background.

4 I am on OS 5.0 or higher (am NOT interested by implementations of 4.x)

5. I would like to use the setBackground (BackgroundFactory things if possible.

First thing, I've tried:

1. I can't scale carried out with the help of a routine I found in positions that scales an image coded. It seems to work very well, but it takes as parameters Display.getWidth and Display.GetHeight and the height will be turned off because it includes the height of the title bar.

2. I can pass the bitmap scaling the setBackground (... well BackgroundFactory of things.

The problem is that the lower part of the image is cropped by what seems to be at the height of the title bar. So I went then on a safari in trying to find a way to determine the height of the title bar. Was able to get the height by substituting the method sublayout as one of the positions. That's nice, but the sublayout does not draw after the manufacturer of the screen which is where I would need to adjust the scale value. I also tried the override of the method of painting (both on-screen and in a clever separate VerticalFieldManager (thanks to BB_DUDE).

I'm puzzled not to mention frustrated as you can guess. Surely this issue was properly resolved for 5.0 installation? I know I'm a newbie, but I am at a loss to continue. I've seen all the posts that just say 'the search will give you an answer. " I searched for two days! What I don't understand is why the background don't lie not in the title bar? (It's below everything else!). I understand the definition of a new value for money approach, but I still couldn't it either works. The implementation of the missions I've tried always have cropped down image. There must be something obvious that I'm on. It can't just be this hard! I am at the point to forget the title bar and build my own that will sit on top of the background

Any help would be appreciated! (Yes, I saw the screen explained as well).

Well, after dinner, drinks and meditation I have revisted the questions. Here's my situation:

My first implementation was:

this.getMainManager () .setBackground (BackgroundFactory.createBitmapBackgroundUtilities.GetBackgroundImage));

where Utilities.GetBackgroundImage () is my method of support of:

CImage EncodedImage = EncodedImage.getEncodedImageResource ("bottomlogobackground.png");

EncodedImage sImage = Utilities.SizeImage (CImage,Display.getWidth (),Display.getHeight ());

Return sImage.getBitmap ();

I think that my mistakes to be:

a. the encoded image and image logical size is extracted from some forum posts. I miss-interpreted that the scale must take place before the call to the method BitmapFactory.createdBitmapBackground ().

(b) "control" me was not recognizing that the BackgroundFactory.createBitmapBackground () method has an overload to allow not only the alignments of XY, but the 3rd parameter to indicate the appropriate size! DOH!

My successful implementation is:

Bitmap Imagearriereplan = Bitmap.getBitmapResource ("bottomlogobackground.png");

this.getMainManager () .setBackground (BackgroundFactory.createBitmapBackground (backgroundBitmap, Background.POSITION_X_LEFT, Background.POSITION_Y_TOP, Background.REPEAT_SCALE_TO_FIT));

No need to do any scaling before the call so I can eliminate my routines of support for 'Utilities '. It seems to work very well. In addition, all this is done against the Manager of vertical not with default scrolling field, i.e. I don't have to create a subordinate value.

If anyone knows the faults of the above, let me know. It seems to work correctly. I'll be making additional GUI development now (probably I will have others not of fake beginner!)

Thanks for the ear...

Tags: BlackBerry Developers

Similar Questions

  • Bitmap scaling problem

    I have a simple yet unusual problem... I can't scale a bitmap despite the use of scaleinto class. BTW, I use the BB Torch Simulator.

    My code is as follows:

    Create background bitmap

    Image bitmap bmpBkg = Bitmap.getBitmapResource ("sunlight2.png");

    Bitmap scaling

    Scaledbitmap bitmap =new Bitmap (Display.getWidth (),Display.getHeight ());

    bmpBkg.scaleInto (scaledbitmap, Bitmap.FILTER_BILINEAR);

    The problem is that even after the operation of scaleinto the height and width of the bmpBkg remain the same...?

    Can someone help me with this please?

    Thank you.

    According to me, Miss me something here:

    After:

    bmpBkg.scaleInto (scaledbitmap, Bitmap.FILTER_BILINEAR);

    isn't the Bitmap scaling in scaledbitmap rather than bmpBkg?

  • Controls not destructive bitmap scaling in the FW

    Hi everyone, I was doing research if the new FireWorks CS3 handles transformations of scale - as does Indesign, non-destructive.

    The problem: when you place a bitmap in FW and resize it, pixel data are retired or interpolated (upwards or downwards), and increase of additional refinements of scaling the image degradation. (Photoshop is that there are much too). On the other hand, Indesign will scale only a preview or a proxy of the image and updates the display bitmap in the source file. Therefore, no data is lost when the design changes.

    The goal is to be able to prototype and create a presentation with maximum freedom. Thoughts?

    Alex, great suggestion - I had not thought of that. I've only experimented with it... beautiful! At first, I noticed the absence of the possibility to crop the symbol (edit--> selected bitmap harvest) directly in order to have multiple instances with different croppings... but then the workaround is just to create a mask for each instance.

    I think my problem is solved...

    Quote:
    Select the bitmap into a graphic symbol.

  • I get a JavaScript Application error: "setTimeout" called on an object that does not implement the interface Window for Firefox.

    I get a pop up box with the message: Application JavaScript error: "setTimeout" called on an object that does not implement the interface Window for Firefox.

    But it seems to appear when I go to Amazon.com. Then he opens with this message and the OK option? But as fast as I can click OK, another box appears. After all a half dozen, she disappears - until what I move to another part of Amazon! I uninstalled - reinstalled and then - Firefox and BA. I do not understand this!

    (And of course, there is always the possibility that it is not only attacking me on Amazon... There may be a lot of other sites that also trigger, and I just haven't been there yet.)

    Hello

    Try Firefox Safe mode to see if the problem goes away. Firefox Safe mode is a troubleshooting mode that temporarily disables hardware acceleration, restores some settings and disables add-ons (extensions and themes).

    If Firefox is open, you can restart Firefox Safe mode in the Help menu:

    • In Firefox 29,0 and above, click on the menu button

      click Help

      then select restart with disabled modules.

    • In previous versions of Firefox, click on the Firefox button in the upper left of the Firefox window and click help (or click on help in the Menu bar, if you do not have a Firefox button) and click on restart with disabled modules.

    If Firefox is not running, you can start Firefox in Mode safe mode as follows:

    • On Windows: Hold down the SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac: Hold the option key during the startup of Firefox.
    • On Linux: Exit Firefox, go to your Terminal and run firefox-safe-mode
      (you may need to specify the installation path of Firefox for example/usr/lib/firefox)

    When the Firefox Safe Mode window appears, select "start mode safe."

    If the problem is not present in Firefox Safe Mode, your problem is probably caused by an extension, theme or hardware acceleration. Please follow the steps described in the section Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems to find the cause.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. This might help others with the same problem.

  • Implement the Std::Vector < < Point2i > > Std::Vector in dll wrapper for LabVIEW

    Hi, I'm writing a wrapper dll that using OpenCV function. I had been sucessfully implement Std::Vector by referring to "An array of clusters to a dll C sending".

    And now, I want to implement the Std::Vector<>> who is a lot like table 2D but each line items may be different.

    In LabVIEW, I attribute a range of cluster of the dashboard cluster of 2 I32 elements, structure which is shown below:

    I think it has the same functionality as Std::Vector<>> in C++.

    So I plug this data on the "Call library function node" structure and generate C code that indicated below:

    /* Call Library source file */
    
    #include "extcode.h"
    
    /* lv_prolog.h and lv_epilog.h set up the correct alignment for LabVIEW data. */
    #include "lv_prolog.h"
    
    /* Typedefs */
    
    typedef struct {
        int32_t elt1;
        int32_t elt2;
        } TD4;
    
    typedef struct {
        int32_t dimSize;
        TD4 elt[1];
        } TD3;
    typedef TD3 **TD3Hdl;
    
    typedef struct {
        TD3Hdl elt1;
        } TD2;
    
    typedef struct {
        int32_t dimSize;
        TD2 elt[1];
        } TD1;
    typedef TD1 **TD1Hdl;
    
    #include "lv_epilog.h"
    
    void funcName(TD1Hdl arg1);
    
    void funcName(TD1Hdl arg1)
    {
    
        /* Insert code here */
    
    }
    

    Then, I write this code show below in dll wrapper:

    void funcName(TD1Hdl Blobs)
    {
        vector < vector > blobs;
    
        // Distribute contents of blobs to Blobs from LabVIEW
        MgErr err = mgNoErr;
        size_t arraySizeInBytes = Offset(TD1, elt1) + sizeof(TD2)*blobs.size();     // Determine row size
        err = DSSetHSzClr(Blobs, arraySizeInBytes);
    
        if (err != mgNoErr)
            return;
    
        (*Blobs)->dimSize = blobs.size();
    
        for (size_t i = 0; i < blobs.size(); i++) {
            arraySizeInBytes = Offset(TD3, elt) + sizeof(TD4)*blobs[i].size();  // Determine col size of each row
            err = DSSetHSzClr((*Blobs)->elt[i].elt1, arraySizeInBytes);
    
            if (err != mgNoErr)
                return;
    
                    /*......................*/
            }
    }
    

    When I call LabVIEW dll, the program get interuption(i.e shutdown) on line where I want to determine the size of each row.

    Could someone give me some suggestions on this subject or promote another application of this requirement?
    Thank you very much.

    MgErr funcName(TD1Hdl Blobs)
    {
        vector < vector > blobs;
    
            Labeling(image_binary, blobs);         // the prototype of this function is: Labeling(Mat &binary, Vector> &blobs)
    
        // Distribute contents of blobs to Blobs from LabVIEW
        MgErr err = mgNoErr;
        size_t arraySizeInBytes = Offset(TD1, elt) + sizeof(TD2)*blobs.size();      // Determine row size
    
            if (contours == NULL)        {                Blobs = (TD1Hdl)DSNewHClr(arraySizeInBytes);                if (Blobs == NULL)                         err = mFullErr;        }        else                err = DSSetHSzClr(Blobs, arraySizeInBytes);
            if (err != mgNoErr)                return err;    for (size_t i = 0; err == mgNoEerr && i < blobs.size(); i++) {
            arraySizeInBytes = Offset(TD3, elt) + sizeof(TD4)*blobs[i].size();  // Determine col size of each row
    
                    if ((*Blobs)->elt[i].elt1 == NULL)                {                        (*Blobs)->elt[i].elt1 = (TD3Hdl)DSNewHClr(arraySizeInBytes);                        if ((*Blobs)->elt[i].elt1 == NULL)                                    err = mFullErr;                }                else               err = DSSetHSzClr((*Blobs)->elt[i].elt1, arraySizeInBytes);
                    if (err == mgNoErr)                {                        (*((*Blobs)->elt[i].elt1))->dimSize = blobs[i].size();
    
                            /*......................*/
    
                    }
            }
            (*Blobs)->dimSize = i;        return err;}
    

    Personaally I've usually done like this. Already, the tar of DSSetHSzClr() indicates if there was something wrong and that the handle cannot really become NULL to call this function.

    To be entirely correct and safety integrated, you must do more than that. But as long as you assume that the incoming picture is always smaller that the outgoing Board will be (usually it be 0 items when you enter this function, but if you reuse sort table in the diagram, by storing it in a registry change for example, this may not be true more) this will be enough.

  • Must my webworks games implement the Scoreloop for approval or just to get into the construction of BB program?

    Must my webworks (for BB10) games to implement the Scoreloop for approval or just to get into the construction of BB program?

    Originally using Scoreloop was a requirement for the criterion of integration of services with the games, but this requirement has apparently been removed, as mentioned in one of the webcast that we expect them to post here sometime soon: https://developer.blackberry.com/builtforblackberry/documentation/videos/index.html

    Note that this page still says Scoreloop is required: https://developer.blackberry.com/builtforblackberry/documentation/criteria/games.html

    This page, however, has been changed so it is no longer required: https://developer.blackberry.com/builtforblackberry/documentation/criteria/checklist.html

  • Options of alias for POV while implementing the data audit trails

    Hi all

    I have a request to implement the option Alias for the account dimension, which gets exported to the HSP_AUDIT_RECORDS table when the Audit trail for data is enabled.

    In the column of ID2, user want to see Alias name of the Member account.

    Do we not have this feature?

    Kind regards

    NGO

    Audit records will still be stored with the name of the Member, not alias, to do this, you will need to do a post on the table processing and replace the names of the members with the alias, I don't know any other way to get.

  • Select the Bitmap

    I know this is a vague question but could someone try to explain the steps involved in the creation of a selection on a bitmap? (similar to the in Photoshop selection tool). I'm not looking for any code I was wondering what is involved. Thank you.

    OK, it's much more complex.

    For the moment let's ignore touch screens.

    So, basically, you are going to have to display the Bitmap, and then, when the focus is on this bitmap, display a kind of cursor/pointer.  You need to replace the painting and this match draw in front of your Bitmap image.

    This slider will have to meet the navigationMovement.  The user must be able to "click" to select an area, or maybe to do the standard "drag" to select a rectangular area.  Once you have this area (you know where it is because you are viewing the cursor), you use getARGB on the Bitmap image, get rough ints, convert this back to a Bitmap, scaling it.

    Make sense?

  • Any way to hide the trash, sent and drafts folder for some accounts (IMAP)?

    Hello!

    I use thunderbird for quite awhile, I am currently using 38.1 on Win 7 64 bit. I have multiple IMAP accounts, set up, as well as an entry to local folders. I things to be implemented so that the sent copies are not saved, and the project for two IMAP accounts files is set to save to local folders-> drafts.

    However, two imap accounts still have sent and draft entries (that take up valuable space). Is it possible to remove or delete these? I was just as quickly also hiding so if possible the entries of trash for imap accounts.

    I found this thread earlier-
    https://support.mozilla.org/en-US/questions/1010341 ,
    and looked into the unified view. It works really well for me, since I still have all of these entries (though in place of a mimimizable instead of duplicate between all three accounts), and it makes my file appear in a bit of a weird order. I also found the extension "Hide local folders", but it's kind of the opposite of what I need - I would like to draft appears here, instead of in the IMAP accounts.

    Thanks for the tips!

    They come back after a reboot? Restart the computer or what?

    If you enable the message F8 pane, it turns off or reappearing in the same way?

  • Is it possible to implement the special keys to a program name

    Canned commands

    Is it possible to implement the special keys to program a name & address, etc.?

    In addition, if there is a low-cost program that does the same thing please let me know.

    Thank you

    Damon

    Settings - general - keyboard - replacing text

    It works for your needs?

  • Function call to the C - Type not available library for one of the parameters in the Prototype of the function.

    Hello

    I do a work already done by others: implementation of a Wrapper to SQLite LabVIEW, I know how to do with .NET alas I would do that c, mainly for purposes of performance and my pointer poor knowledge is kinda make me stuck.

    Some information is kindly provided here:

    What I want to do is just to open a connection to an SQLite database (if not existing does not, the SQLite engine will create the embedded database and the corresponding file to save the data and everything). The function to perform the operation is indicated in the page below:

    It seems simple enough:

    int sqlite3_open(
      const char *filename,   /* Database filename (UTF-8) */
      sqlite3 **ppDb          /* OUT: SQLite db handle */
    );
    int sqlite3_open16(
      const void *filename,   /* Database filename (UTF-16) */
      sqlite3 **ppDb          /* OUT: SQLite db handle */
    );
    int sqlite3_open_v2(
      const char *filename,   /* Database filename (UTF-8) */
      sqlite3 **ppDb,         /* OUT: SQLite db handle */
      int flags,              /* Flags */
      const char *zVfs        /* Name of VFS module to use */
    );
    

    However, I'm struggling a bit on the following type:

    sqlite3 **ppDb          /* OUT: SQLite db handle */
    

    And I'm not really sure what type to use when calling this function of LabVIEW

    Any idea, I guess it's really easy, but I'm not really used to have a type which is I guess the DataInstance but as it is not clearly explicted in the C library function prototype interpreted LabVIEW (InstanceDataType is logical but not sure if) I'm not really sure what I show in the screenshot is valid or not.

    My VI seems to work like a charm, but am not sure if I'm doing something wrong.

    Another prototype that I have no idea on the appeal proper LabVIEW is the close function:

    I would like to get this straight, usually a parameter has a name, right? but seems not:

    int sqlite3_close(sqlite3*);
    int sqlite3_close_v2(sqlite3*);
    

    Similarly no idea about setting up for this one... must be regarded as the free forum like the one calling this function is... but I don't send any object?

    Really confusing...

    sqlite3*
    

    I might sound really stupid, but if someone could point me to a few tracks, I'd be really grateful for that.

    Thank you

    Ehouarn wrote:

    However, I'm struggling a bit on the following type:

    sqlite3 **ppDb          /* OUT: SQLite db handle */
    

    And I'm not really sure what type to use when calling this function of LabVIEW

    This parameter must be an integer of size pointer, passed by the pointer. No matter whether it was signed or not signed. The SQLite library will allocate memory for you, then put a pointer to this memory in full the pointer location as you go.

    Regarding the close function, you must pass the same integer pointer, but this time he passed by value (because it is referenced with a single *, not two). There is nothing wrong with the documentation by omitting the name of the parameter. For the application of a function prototype, the parameter name is without important, since everything you need to know is the type of data. How the service chooses to refer to this setting internally is irrelevant.

  • I get an error, "the executable file that this service is configured to run does not implement the service" when I try to synchronize the time in Windows XP.

    After trying to fix the error of time synchronization by typing net start w32time that receipt of the message in the title.  In addition, type net stop w32time responded that the service was not working.

    Original title: the executable that this service is configured to run does not implement the service

    After checking the configuration in the registry and check or update if necessary from the link below:

    Then the time errors that I got from the command prompt window:
    Order--> net stop w32time & net start w32time
    Response--> The Windows Time service is not started.

    Order--> net start w32time
    Response--> system error 1083.
    The executable program that this service is configured to run in does not implement the service.

    --> Command w32tm/Resync /rediscover
    Response--> sending command to local computer resync...
    The following error occurred: the RPC server is unavailbale. (0x800706BA)

    Hi Mitchell_G,

    Thank you for keeping us posted.

    The steps of items offered in the previous post?

    We know if you need help. We will be happy to help you.

    Thank you.

  • Why isn't the DPI scaling screen do not accept any change in the size of the font?

    The graduation of DPI on my VISTA system is a custom of 144 DPI set that is too large for my monitor. However VISTA won't let me change the setting. Whenever I have manually change the setting, and then restart the computer, the police will remain the same size. When I return to the DPI screen, it always shows the size of the font as 144 DPI. How can I get the computer to accept my changes?

    I did a scan of virus from the system using Kaspersky w / updated virus definitions, but it showed no infection.

    Recently, I ran a Scan Registry program. It MAY have deleted a file required to run this application correctly. Any thoughts?

    Hello

    You should never use Registry cleaners.

    They can do more harm than any good as they can claim to be able to do.

    Do a system restore before you have run the registry cleaner, then try change DPI.

    http://bertk.MVPs.org/html/restoresysv.html

    «How to set the DPI Scaling in Windows Vista»

    http://Windows.Microsoft.com/en-us/Windows-Vista/make-the-text-on-your-screen-larger-or-smaller

    See you soon.

  • Implement the application has stopped working. A problem caused the blocking of the program works correctly. Windows will close the program and notify you if a solution is available. »

    Try to install a CD "the Start-Stop software installation", but whenever I try, I get the following. Implement the application has stopped working. A problem caused the blocking of the program works correctly. Windows will close t he program and notify you if a solution is available. I sent the company and the school several times and have not yet received a response, maybe someone out there could help. Thank you!

    Ok.

    See if they have a patch for it.

    If this isn't the case, you may need to shopping for a similar program.

    Or repost in the Forum of programs on the link I gave you; they can learn more on this subject here.

    See you soon. Mick Murphy - Microsoft partner

  • How to implement the ScreenUiEngineAttachedListener Interface?

    How to implement the ScreenUiEngineAttachedListener Interface? It is somewhat a mystery reading through the API.

    I have a class that implements ScreenUiEngineAttachedListener:

    public class UiListener implements ScreenUiEngineAttachedListener {
      public void onScreenUiEngineAttached(Screen screen, boolean attached) {
      }
    }
    

    Then I have a class MyScreen which extends from screen and has two methods:

    public void addScreenUiEngineAttachedListener(ScreenUiEngineAttachedListener listener) {
      super.addScreenUiEngineAttachedListener(listener);
    }
    
    private void removeScreenUiEngineAttachedListener() {
    
    }
    
    • What is the correct positioning of everything?
    • Can I define an instance of UiListener and pass in the addScreenUiEngineAttachedListener?
    • How to remove UiListener in removeScreenUiEngineAttachedListener?

    You will need:

    • an instance of your UiListener - probably a static member inside your UiApplication;
    • a method that allows to retrieve the reference to this instance of UiListener;
    • a call in your constructor for the screen at addScreenUiEngineAttachedListener (yourApplication.getUiListener ()) or similar;
    • potentially a call within your onScreenUiEngineAttached (attached screen, boolean) routine, the branch (attachment is false) : screen.removeScreenUiEngineAttachedListener (this);

    However, all this is too much work for no gain. Just override protected void onUiEngineAttached (boolean attached) in your screen class and make your logic there - all members of your class are accessible and all the code is placed where it belongs.

Maybe you are looking for