Impossible to get drawBitmap to work

Hello

I read a lot of discussions and tutorials on drawBitmap to help, but I'm still stuck. When the user clicks on a button, I need to display one transparent png heap on another to create a display. I'm stuck to display only on the png, and fewer still those overlapping.

I was hoping that someone could take a look at my code and tell me why my finger1.png is displayed. maintitle.PNG and buttons display as I want. Can anyone find where I have gone wrong?

Net.rim.device.api.ui import. *;
Net.rim.device.api.ui.component import. *;
Net.rim.device.api.ui.container import. *;
Net.rim.device.api.system import. *;

class Menu extends UiApplication
{

Private button1 As ButtonField.
private ButtonField button2;
private ButtonField button3;
private ButtonField button4;

Public Shared Sub main (String [] args)
{
App menu = New Menu();
app.enterEventDispatcher ();
}
   
public Menu()
{
Screen MenuScreen = new MenuScreen();
Bitmap objBitmap = Bitmap.getBitmapResource ("maintitle.png");
BitmapField objHeader = new BitmapField (objBitmap);

Button1 = new ButtonField ("button1") {}
protected boolean trackwheelClick (int status, int time)
{
Screen2 MenuScreen = new MenuScreen();

Bitmap img = Bitmap.getBitmapResource("images/finger1.png");
Graphics g = screen2.getGraphics ();
g.drawBitmap (0,0,18,18,img,0,0);
Returns true;
                
}
};

Button2 = new ButtonField ("button2");
Button3 = new ButtonField ("button3");
Button4 = new ButtonField ("button4");
HH FlowFieldManager = new FlowFieldManager();
HH. Add (button1);
HH. Add (button2);
HH. Add (button3);
HH. Add (button4);
Screen.Add (objHeader);

Screen.Add (HH);
pushScreen (screen);

}

the final class private MenuScreen extends screen
{

{} public void close()
Super.Close ();
}
}

}

Thank you very much.

Kind regards

Scott

getGraphics() contains this warning in the documentation:

The Graphics object returned by this call is no longer valid and should not be used after the end of the event to the current user interface.

Note: We advise against using this method directly; Use invalidate() various methods instead. It can be used to draw directly on the screen when the screen contains no field.

To work around this problem, you can preload rather this bitmap ("finger1") at the front and then call invalidate() on the screen and paint to paint the screen. How you decide to do it is to you, the lazy (and faster) way is to use a flag, the OO approach more implements a drawable send queue that is strong enough but obviously slower since you must browse (note that I didn't say synchronize .)

Tags: BlackBerry Developers

Similar Questions

  • Equium A100-147: Impossible to get Bluetooth to work

    I bought an Equium A100-147 last week and noted in the manual it should have Bluetooth capabilities. However, I can't get this to work. I looked for my phone, and it does not pick up the computer as a bluetooth device. In the help files, it says I can set it up in the bluetooth settings in the Control Panel, but there is nothing in there. I tried to install the battery Bluetooth Toshiba, but it keeps asking me to install the bluetooth device.

    This computer actually has bluetooth abilities or not? If so, how can I get this to work?

    See you soon

    Hello

    Each unit with BT has BT label in the lower corner. Something like this http://support.toshiba-tro.de/KB0/FAQ35007I001WR01.htm

    If you do not find it the BT is certainly not available.

  • Impossible to get Clip + to work in the Honda Accord

    In my Honda, mode to THE, I can't get the Clip + to work.  I was back and forth between the MTP and MSC.  My old Sansa works very well.  What I am doing wrong?

    Your car stereo is probably looking for a device to MSC base. If your music has been loaded from a computer with the Clip + in MTP mode or Auto Vice, your car stereo will be probably able to find.

    If this is the case, change the Mode USB MTP setting, connect to your computer and move (not copy) all the files on the computer. Now tell-connect, switch mode MSC, reconnect and copy (and not move) the files to the player. This will leave copies of backup on your hard drive. Now connect to your car stereo and it should work.

    Note that sometimes the stereo channels is not enough 'smart' see files stored in a folder of music. If after doing the above, you still have problems, try highlighting all the folders/files 'in' you music folder and moving them to the top directory or 'root' (at the same time the music folder). So he could see them. You can delete the empty music folder if you wish.

    Miikerman also has a good point. Your car stereo will not be able to see 2 memory locations, as in the internal memory and external memory card. He reads only the files from the internal memory.

  • Impossible to get moviemaker to work on my computer. always get the error message, asking if I want to send an error report. __

    trying to open movie maker I get the winbdow which says "windows movie maker has encountered a problem and needs to close" and then askss to send an error report. Downloaded the program again, but keep getting the same message

    Hi jovato,

    Remember to make changes to the computer before that happened?

    I suggest you try the following steps to refine the question:

    Step 1: Put the computer to clean and test start

    Follow step 1 in the link below,

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    If everything works well after a clean boot, you can deduce that some third-party services are at the origin of the problem.

    Continue with the remaining steps to pin-point on the third party service.

    After find you the program that is causing the problem, you will have to perhaps to update or install a newer version of the program, if you rarely use that you should consider uninstalling the software.

    Important: n ' forget not the computer to start normal follow step 7 in the link.

    If the problem persists,

    Step 2: Download and install the latest service pack on the computer


    How to obtain the latest Windows Vista service pack

    http://support.Microsoft.com/default.aspx/KB/935791

     

     

    Thank you, and in what concerns:

    Ajay K

    Microsoft Answers Support Engineer

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Impossible to get keylistener to work on the app

    I'm trying to get back on the phone button to work on my application, but it only quit the application when pushed. I want to go back one screen. My application to open a browser, and then I created this class:

    public class keylistener implements KeyListener {

    {} public boolean keyChar (key char, int status, int time)
    Returns false;
    }

    {} public boolean keyDown (keycode, int, int times)
    If (Keypad.KEY_BACKSPACE is {Keypad.key (keycode))}
    Consume the event.
    Here I use the event for the escape key
    Returns true;
    }
    Let the system to pass the event to another auditor.
    Returns false;
    }

    {public boolean keyRepeat (keycode int, int times)
    Returns false;
    }

    Can someon if you please help me understand how to make this work?

    How do you need process that EVASION depends on how you arrived at the screen you are currently.  Usually, we'll push a new screen on top of the previous, so all you need to do is to pop this screen the display stack and the old screen will be displayed.  To do this, you could code something like:

    {} protected Boolean keyChar (character char, int status, int time)

    switch (character) {}
    case Characters.ESCAPE:
    UiApplication.getUiApplication () .popScreen (this);

    Returns true;
    by default:
    Return super.keyChar (character, status, time);
    }
    }

    But sometimes you can keep viewing the battery deep, just a screen by pushing and popping when you move between screens - this is what you would do to simulate a screen for example.  If you do this, then to deal with an ESCAPE, you must push the previous screen and then current pop.

    Does make sense?

  • Impossible to get Clipboard to work using WINDOWS 7 HOME PREMIUM

    I can't get the Clipboard to work. I use... WINDOWS 7 HOME PREMIUM. I'm pretty calculates illiterate; but can share specific details of Neuropsychiatry. :)

    If anyone can help that doctor who has three masters degrees... but needs quite simple directions, I woud be very grateful.

    Thankx, ANANKA

    08/04/2011

    I don't know exactly what problem you are having with the Clipboard, but the following link can help for a potential problem.  If this isn't the case, answer with more details on what is the problem. Also, if you try to copy the screen to the Clipboard, know that, in addition to PrntScrn, Windows 7 has a key "capture tool" (type Snipping Tool in the search programs and files box immediately above the button Start.  http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-windows_programs/where-is-the-Clipboard-on-Windows-7/3bf718eb-5c47-E011-90B6-1cc1de79d2e2  Re this thread, you can also just paste in a painting or another application to see what is in the Clipboard.

  • Impossible to get webservice to work - LIVES checkVat WSDL

    I am trying to incorporate a tank, check how it works on my Web site, for the validation of VAT entries.
    This service is provided by the European lives WSDL service.
    No matter what I try, I still get the same error:

    Web service operation checkVat with parameters {xx, xxxxxxxxxxx} is not found.

    This is the last code I've tried (perhaps the fifth or sixth method experienced).

    straight from the Coldfusion documentation:

    < cfscript >

    WS = CreateObject ("webservice",

    " http://EC.europa.EU/taxation_customs/VIES/checkVatService.WSDL ");

    ws.checkVat ("xx", "xxxxxxxxxxx");

    Req = getSOAPRequest (ws);

    < / cfscript >

    < cfdump var = "#req #" >

    < cfset soapreq = GetSOAPRequest (ws) >

    Request SOAP < h2 > < / h2 >

    < cfdump var = "#soapreq #" >

    < cfset soapresp = GetSOAPResponse (ws) >

    a response SOAP < h2 > < / h2 >

    < cfdump var = "#soapresp #" >

    Where red x represent the country code and VAT number.

    I'm about to drop, three days ago to try and still no luck.
    Someone ready to hit his head with mine?

    Thanks anyway.

    I think the error is more profound than the conversion of any type. For some reason, Coldfusion 8 is ruining the web service definition.

    response = ws.checkVat ("Go", "244155576", requestDate, "name", "base10", True);

    This is probably not correct. In fact, when I run on Coldfusion 11, where the function with two arguments work, I get the error message

    "Web service operation checkVat with parameters {GB, 244155576, kills Sep 30 09:15:45 CEST 2014, True, base10 name} can not be found."


    However, looking back with fresh eyes this morning, I found the final reason why the 6-argument function won't work anyway. Your result, it returns void.

  • Impossible to get a style work table with dat Spry in DW CS6

    Hi - I hope someone can help me to get a table style to work as a Spry data set. I first put in place a beautiful table with extendable drop down:

    http://designerandpublisher.com/tables/index.html

    I then followed this Adobe tutorial:

    http://www.Adobe.com/devnet/Dreamweaver/articles/spry_creating_html_data_set.html

    For the final result, you can see that all of the style has been removed:

    http://designerandpublisher.com/tables/Spry-test.html

    Although when you click the column header, sorting seems to work great, but I obviously cannot submit this to the customer because it does not resemble the style table.

    Can someone tell me what I am doing wrong?  I thought by styling the table first and then put in Spry, I thought it would work.  I also get this data style set working for the customer because I used Spry for other things like accordions and it is easy to use.

    Thank you.

    Just thinking a little further, with stretch panels Table seems to work pretty well. Why would you want to complicate things by introducing a dataset?

  • Impossible to get FP to work.

    After an accident due to a power failure, FP does not work. I ran repair disk, uninstalled FP, removed records offered and reinstalled to get a "Successful Installation" message but still no joy.  I'm under IE9 with Vista.  In looking at FP in uninstall in Control Panel, the program displays towards the top but no size, which seems strange.  I did everything except touch the registry, several times with no luck.  You are looking for assistance.  Thank you.  Tony

    Hi Tony,.

    The forum of Flash Player at following link contains essential steps to overcome the view of IE 9 questions: http://forums.adobe.com/thread/885448. Please try it and let us know.

    With respect,

    Prabhu

  • Impossible to get favicon to work

    I'm trying to get a favicon to work with DW8. I created a 16 by 16 jpeg file, renamed favicon.ico and placed in my root folder. Then, I went to insert > HTML > Headtags > link and entered the information Href and Rel. Nothing happens.

    I searched the posts on this forum and tried all the options for others having the same problem of double code for "stirring" the file. Nothing works. Can someone give me some advice on what to try next? You can see the code at http://www.keystonemkg.com

    Kevin

    April 28, 2008 in macromedia.dreamweaver, Kevin E. says:

    > I decided to give it an another stab with another domain. I created a
    > simple graphic, 16 by 16, favicongenerator used to convert to a
    > icon and downloaded on the website. Then I took the favicon code and
    > entered. Then tested. Same result. Please take a look and see if
    > you see something of this trial.

    If you mean, by 'favicongenerator', the creator of favicon online at
    http://www.favicongenerator.com/, the 'favicons' he is creating are all
    JPEG files with the extension .ico. If you want that your favicons to appear in
    IE6, * DO NOT USE THIS TOOL TO CREATE SOME FAVICONS *. Use other
    method - the extension of Fireworks or Photoshop or Irfanview if
    you're on Windows. Mac users - any suggestions?

    --
    Joe Makowiec
    http://Makowiec.NET/
    E-mail: http://makowiec.net/contact.php

  • Impossible to get SWF to work online

    I inserted a flash swf file into my dreamweaver document ~ it works fine on my computer but not when I download.
    Here's the url http://dkdesignstudio.com/BEE/index.htm
    the white box is the missing swf.
    I tried to dumbing down the Flash 8, 7, 6, 5 and 4. I tried with html and without. I downloaded the files and script files. I tried to put in the pictures folder and let it sit next to the html. I also tried this direct to the folder root on my server. nothing works.
    I have not had this problem before in cs2.
    can anyone help?

    figured it out. in fact, you have TO work within a site managed in Dreamweaver to get the folder _notes with some inside .mno files that must be downloaded with your swf file.
    There are 4 hours of my life, I wish I could come back.

  • Impossible to get Safari to work with BT Internet email

    I can not Safari to work with BT Internet email. Whenever I try to connect to my email account it comes with just a blank page.

    It works very well with Firefox, but I would prefer to use Safari.

    I disabled all extensions Safari and made sure the cache has been clear. I spent ages on the phone to BT this morning, but the question certainly seems to be with Safari.

    Am I alone with this problem?

    Just answered my own question. BT obviously don't like users using private browsing. It was the only thing I never thought

  • Impossible to get Firefox to work.

    No matter what I try, I can't do your browser. Something downloaded avast and now ALL I can get is Yahoo. Help, please!

    Happy to help you.

  • Issue of dual sim - impossible to get two sims work

    I have a sim card I want to use for phones / SMS and the other that I want to use for mobile data.

    If I put two sim itself, it works very well.

    If I combined both and set them so that they are both on, that I want to use for the phone calls and texts does not record on its network (which is three in the United Kingdom)

    I don't know what to do. The telephone company have adjustable it so it does not work in a setting dual sim?

    Or have I just don't understand what is dual sim?

    Any help much appreciated!

    Stoichkov-

    The phone is dual SIM which means that standby, either number can receive a phone call. If you can not do mobile data and voice at the same time. You can prioritize the phone for voice or data. If prioritize you data and you surf the net and you receive a call, the call will go to voicemail. If you have a priority to voice then the call will ring through and data will stop.

    You should be able to do the WiFi and voice simultaneously.

    You can have live data on a SIM card at a time. Hope that things cleared up.

    Mark

    Forums Manager

  • Impossible to get ontouchenter to work

    I can't ontouchenter to work for an element node raphael.js although ontouchstart works very well. I am programming for a playbook. Any help will be welcome.

    Thanks, but I solved my problem by testing for event.target.id

Maybe you are looking for

  • iCloud contacts will not sync on macOS Sierra

    The contact.app on my mac does not download the new contacts I added to iClound via iPhone. I'm sure that the contacts are added successfully I checked on iCloud.com. I also check and unchecked "enable this account" (account iClould) in Contacts.app

  • Firefox is spoil fonts

    Problem just started yesterday for no reason. I tried everything to fix this. Reinstall, cleaning of profile etc files. It is useful, but only for a short time (about 15 minutes), then the fonts are weird, with no smoothing and not in bold whereas th

  • Message window "Not connected to the internet" appears when you have MS and downloads updates.

    Whenever I try to use Windows Update or download MSE I tells me that my computer is not connected to the internet.  My web browser works fine, only when updating or loading of a product of MS IE. Silverlight, LifeCam, MSE... I have not done the clean

  • Delete virtual disks now SATA CD ROM drive is not BOOTABLE: R510

    Im a novice admin with poor patience and I think I screwed up majorly on reinstalling OS 2008r2 I thought I'd create a RAID by enabling it in BIOS and by removing all the virtual disks in the PERCs300 GUI. BIOS not installed no. found virtual disk. i

  • BlackBerry Smartphones Desktop Software 5 on Win 7 - not Outlook synchronization

    Hello had to reinstall my laptop and went to Win7. Installation went well and most of s/w works. So far so good. Installed BB Desktop Software 5.0.1 and got the error message during installation (as shown in the photo). DS starts up normally and dete