J2ME Image / Graphics problem my misunderstanding?

Hi,
Cannot find a J2me forum so I'm posting here :)
I have a mutable Image which I am using as an offscreen buffer. I initialise this image by setting the colour to white and calling the fillRect() method with the screen size as parameters. I do this in the constructor for my Canvas object.
In my paint() method I then draw only the extra things on the backbuffer (since I have already filled the image with white) and use the drawImage() method of the screens Graphics object to copy the backBuffer onto the screen of my device.
The problem is that text from the previous Form shows up, as if I have not filled the backBuffer with a white rectangle....
Code :
Initialisation :
backBuffer = Image.createImage(screenWidth,screenHeight);
Graphics g = backBuffer.getGraphics();
g.setColor( 255, 255, 255 );
g.fillRect( 0, 0, getWidth(), getHeight() );
In my paint() method :
Graphics saved = g; // Save the frame buffer
g = backBuffer.getGraphics();
g.setColor(255,0,0); // change the colour to red
// Draw the selection box.
g.drawRect(x,y,imageWidth,imageHeight);
saved.drawImage(backBuffer,0,0,Graphics.LEFT|Graphics.TOP);
Thanks,
Norris

backBuffer =
Image.createImage(screenWidth,screenHeight);
Graphics g = backBuffer.getGraphics();
g.setColor( 255, 255, 255 );
g.fillRect( 0, 0, getWidth(), getHeight() );you initialise the backBuffer size to screenWidth by screenHeight
yet, when you clear the image, you use the canvas's width and height
g.fillRect( 0, 0, getWidth(), getHeight() );this is wrong, you should either have
g.fillRect( 0, 0, backBuffer.getWidth(),backBuffer.getHeight());or
g.fillRect( 0, 0, screenWidth, screenHeight);rob,
p.s. next time, post MIDP questions in this forum...
http://forums.java.sun.com/forum.jsp?forum=50
Hi,
Cannot find a J2me forum so I'm posting here :)
I have a mutable Image which I am using as an
offscreen buffer. I initialise this image by setting
the colour to white and calling the fillRect() method
with the screen size as parameters. I do this in the
constructor for my Canvas object.
In my paint() method I then draw only the extra things
on the backbuffer (since I have already filled the
image with white) and use the drawImage() method of
the screens Graphics object to copy the backBuffer
onto the screen of my device.
The problem is that text from the previous Form shows
up, as if I have not filled the backBuffer with a
white rectangle....
Code :
Initialisation :
backBuffer =
Image.createImage(screenWidth,screenHeight);
Graphics g = backBuffer.getGraphics();
g.setColor( 255, 255, 255 );
g.fillRect( 0, 0, getWidth(), getHeight() );
In my paint() method :
Graphics saved = g; // Save the frame buffer
g = backBuffer.getGraphics();
g.setColor(255,0,0); // change the colour to red
// Draw the selection box.
g.drawRect(x,y,imageWidth,imageHeight);
saved.drawImage(backBuffer,0,0,Graphics.LEFT|Graphics.T
P);
Thanks,
Norris

Similar Messages

  • X230T - Major Windows 8 Graphics Problems

    Hi all,
    I own a X230 Tablet with the Intel HD4000 running Windows 8 Release Preview. I know it's still a beta but I was just wondering if anyone else has run into major graphics problems on Windows 8 Release Preview. I'm currently using the most up to date W8 64 bit Drivers from intel.
    There is a huge amount of clipping, flickering and white backgrounds being shown as black. The apps I've noticed this in are OneNote MX (whenever pen input done), Windows Reader (All PDF white backgrounds are shown as black) and Internet Explorer 10 Metro (Tab previews have black bacgrounds). This is strange to me, though I've found at least one other X230T owner with identical problems.
    Pictures, videos and descriptions can be found here: http://answers.microsoft.com/en-us/windows/forum/windows_8-winapps/intel-hd4000-onenote-mx-w8-reader...
    Just wondering if Lenovo engineers are aware of this issue and if a fix exists/ is being worked upon. It's somehwat fustrating as it makes many core Windows 8 experiences unsuable (which was the point of buying a touch screen laptop).
    Thanks
    Solved!
    Go to Solution.

    welcome to the community.
    how do the intel beta drivers you're running compare to the beta lenovo drivers available in the matrix here:
    http://support.lenovo.com/en_US/downloads/detail.page?DocID=HT072084
    actual video driver here:
    http://support.lenovo.com/en_US/downloads/detail.page?&DocID=DS030728
    posted 2 days ago.
    cheers.
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество
    Community Resources: Participation Rules • Images in posts • Search (Advanced) • Private Messaging
    PM requests for individual support are not answered. If a post solves your issue, please mark it so.
    X1C3 Helix X220 X301 X200T T61p T60p Y3P • T520 T420 T510 T400 R400 T61 Y2P Y13
    I am not a Lenovo employee.

  • Why am I Having Graphics Problems with the Latest Version 29.0.1 of Firefox?

    It seems like after I installed version 29.0.1 of Firefox, I'm having intermittent graphics problems I've never had before with any previous version and I don't have with any of my other browsers.
    Sometimes Firefox just scrambles the web pages on all of the tabs I have open. No other components of the Windows XP desktop have graphics problems when this happens and no other open applications seem to have graphics problems. It's just Firefox. Sometimes I can refresh the tab/page (F5) and it clears up the blotchy random graphics characters.
    Does anyone know if there were changes to the graphics engine in version 29.0.1?
    Thanks!

    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    Use a compressed image type like PNG or JPG to save the screenshot.
    Try to create a new Boolean pref on the about:config page via the right-click context menu with the name <b>layout.paint_rects_separately</b> and set the value to true and leave hardware acceleration enabled.
    See comment 414 in bug 812695:
    *https://bugzilla.mozilla.org/show_bug.cgi?id=812695#c414
    That way you still have the benefit from hardware acceleration, but may not suffer from rendering issues.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    *https://support.mozilla.org/kb/upgrade-graphics-drivers-use-hardware-acceleration

  • Image Resizing Problem

    Hello,
    I am working on image project. The task which I want to do is to resize the image. I am using normal java.awt.image package. The classes which I am using are AffineTransformOp for scaling an image, Graphics and BufferedImage etc. The problem is when I scaled down an image of large image to low image (e.g. 800 x 800 to 160x160), The image gets blued or some pixels are looking stretched. I have tried severl other 3rd party APIs but failed. However if i conver 400x400 image to 160x160 .. it works fine. I need quick help..plz if somebody can suggest any solution..
    Thanks

    try {
         AffineTransformOp op = null;
    BufferedImage tempImage;
    double xScale = (double)((double)x/(double)width);
    double yScale = (double)((double)y/(double)height);
              BufferedImage outImage;
              OutputStream os;          
    op = new AffineTransformOp(AffineTransform.getScaleInstance(xScale,yScale),AffineTransformOp.TYPE_BILINEAR);     tempImage = op.filter(original, null);           
    } catch (ImagingOpException e) {
    e.printStackTrace();
    System.out.println("Exception while creating imgages");
         }

  • Yosemite graphical problem

    Hi all, I have encountered a graphical problem for my mbp after upgrading to Yosemite. The computer would sometimes suddenly freeze, and the image on the screen would be blurred. I tried to fix this using disk utility, but in the middle of verifying disk, it had a prompt and told me to fix it in OS X Recovery. When I restarted the computer and entered Recovery Disk, however it could't recognize my Disk. The computer still works, but it's not stable, it seems like the same problem can happen any time. Anyone had the same problem? Thanks in advance. 

    enrique675 wrote:
    Back up as much of the data as possible and replace the disk.
    Your hard drive is failing. You need to replace it before installing anything.

  • Colourful squares graphics problem

    Hey folks,
    I've got a recurring graphics problem where on certain applications green and purple squares/lines begin to hover and flicker on the screen. Also, graphics on games such as Civilization IV are distorted, and also exhibit said squares. I've seen this happen on PhotoBooth, Coverflow, Safari, and image heavy pdfs on Preview. I've never seen them playing movies or Photoshop.
    http://img176.imageshack.us/img176/5051/problem2kj1.png
    What's odd is that I can screen capture them, and with them there, things still function properly (mouse, keyboard, applications). Also, sometimes they go away, and can be 'deleted' by moving a window around the screen to 'erase' them. Other times, they just accumulate. Usually a restart is required to get rid of them, but if I open the same application again, boom! Back again.
    I'm guessing, after reading on all these forum discussions, that it could be a graphics card error or something, but I was wondering if anybody else had any insight/answers, or advice about what to do or what to tell the Apple Support people down at the store/on the phone.
    Thanks in advance!

    An error like this, especially if it reoccurs frequently and/or causes crashes or kernel panics is usually a very good indicator of bad Video RAM. That's a hardware problem that will require Apple to replace your entire logic board (since the VRAM is soldered to the board).
    Take the computer to your local Apple store along with the photos you have of the problem. Explain the situation to the genius and he'll most likely send your laptop off for repairs.

  • Satellite A60-793: graphics problem

    Hi, I'm posting to get help to solve a graphics problem for my A60... Some images, in the browser, appear distorced and with a low quality. What can i do to solve it?
    Thanks, Pedro Marques

    Hi,
    which browser do you use? MS iexplorer, Mozilla, Opera or another one?
    Do you use the Toshiba recovery OS or an own full installation? Is there a Antivirus and a Firewall runing?
    When does the problem occure? Only at images, if yes, which kind of image type, or fonts also affected?
    Is it difuse or a failure with the colors? Describe it a little bit more detailly!
    In the end if these suggestions doesn't help, please use the Toshiba Recovery CD to setup a new system! Then everything should be ok!
    Bye Pete

  • Graphics problem with mbp late 2008,nvidia geforce 8600m gt.any help?

    Hi,have graphics problems with my MacBook Pro 17" Late 2008.Every 3-4 days the graphics are not ok and when i want to restart there is only the apple logo but not clear and the cursor seems to be double.Sory my english is not the best.Any help for this Problem?

    Get your computer to an Apple Store Genius Bar ASAP to be tested for the problem described in this article:
    http://support.apple.com/kb/TS2377

  • TouchSmart 600-1050 - Graphics Problem with MS Outlook

    I have a TouchSmart 600-1050. When I open MS Outlook, and then open the Calendar in a separate window, the window opens as non-maximized and everything is fine. When I maximize the window (I start in Week view), the tasks below each day do not stretch to fit their now wider column. It's as if the graphics don't recalculate for that screen element. Once I am maximized and see the problem, I have to switch to another view (e.g. Month or Day) and back to Week and it will fix itself. Feels like a graphics problem, underpowered chipset or bug in driver (?).
    This was not a problem on my HP Desktop I had before, and it is not a problem on my 3 year old Lenovo ThinkPad X60. All are running W7 and using Office 2007.
    Any ideas? The graphics driver is up to date according to HP Update and Device Manager.
    Thanks!

    Thanks for your reply. I tried both of your suggestions and the issue occurred in both. I've never noticed the sub-content not maximizing properly in other apps, but haven't tested thoroughly.
    Any other ideas would be greatly appreciated.
    - Should I checked a different way to see if I have the latest drivers?
    - Is there any way for me to upgrade my 600-1050 with the graphics card in the 600-1055? The 1050's "Mobile PCI Express Module" is open/available. Could I buy the nVidia GeForce GT 230 that comes with the 1055 and hook that up?
    Only reason I suggest this is that the graphics seem sluggish to update at times.
    Thanks.

  • W7/64-bit on W500 - Switchable Graphics problem

    Hi,
    Did a clean install Windows 7 Ultimate (64-bit) on my Thinkpad W500 (4062-3CG).
    Having problem with "ThinkPad Switchable Graphics Driver for Windows 7".
    ATI driver won't load, so default Intel chipset is used with poor graphics as a result.
    I have also tried "Windows 7 BETA Drivers and Utilities" with no luck.
    Yesterday the graphics worked for a short period of time, that was after remoting my Thinkpad with RDP? very strange. But after reboot graphics was back to non functional again.
    Any ideas?
    TIA
    Johan

    Did you apply Lenovo driver packages in any specific order? Don't really understand what I missed?
    My plan was to do a "clean" W7/64 install and after that run ThinkVantage System Update 4.0 for latest drivers.
    In my case ThinkVantage System Update 4.0 could not start without Access Help for Windows 7 installed, that was the first dependency problem.
    However, after that ThinkVantage System Update 4.0 run successfully and everything works fine but the ThinkPad Switchable Graphics Driver for Windows 7.
    The ThinkVantage System Update 4.0 applied latest updates for everything including the BIOS. When I try to run BIOS update separately for getting around the graphics problem it says BIOS version is OK and no update needed.
    Tried to disable Switchable Graphics in BIOS-setup using Discrete but that does not fix my problem?

  • I have LR5 on a mac book pro with a external hard drive with LR5 images. my problem is my external hard corrupted reformatedand have to this is expensive and i would to start over in LR5

    i have LR5 on a mac book pro with a WD external hard drive with my with my LR5 images . my problem is my external drive is corrupted .i was told by apple that my macshow the hard drive is there but it is not moumting and have to be reformat. i have to use recovery data to save my images on my external before i can refomat.iam willing to lose my images on my extenal hard drive but i would like to know can i erase my LR5 images and start over or delete LR5 and download it again

    Simply start a new catalog:
    File >> New Catalog
    Choose a new name and save.
    When the empty catalog launches you are ready to start over.

  • My iMac 27" Late 2012 has Image Persistence Problem

    I'm wondering what to do about an annoying image persistence problem on my 27" late 2012 iMac. I got the iMac just a few days ago. Monday actually, so 4 days ago.
    It's the 3.4GHz i7, 8GB, NVIDIA 680MX 1TB fusion drive model.
    Overall it has become the love of my life, but the image persistence thing is getting harder to ignore. This happens after only a few minutes of use. If I follow Apple's instruction on dealing with LCD image persistence, I can make it go away for a while, but it comes back very quickly.
    It is extremely noticeable on a plan dark background. It looks as thought he screen has been left on for a very long time with the same windows open, but it occurrs in less than 5 minutes of use with nothing more intense than a bit of web surfing.
    I've read that this is happening a great deal on these new iMacs, particularly teh 27" machines.
    While the problem seems to be known to those of us afflicted I don't know if Apple has acknowledged an issue or not.
    Here is a sample of the complaints: http://forums.macrumors.com/showthread.php?t=1509571
    I can make the ghost image vanish by bringing up an all white scree for a minute or so or using LCD Scrub.
    I'm wondering if anyone else has foun a solution other than asking for a replacement computer, which Apple seems to be granting on this issue?

    Avoiding image persistence on Apple (IPS) displays
    Avoiding image persistence on Apple LCD displays
    If you cannot resolve the issue yourself, then return the computer for a replacement. You may do this freely within 14 days from date of purchase, so don't delay.

  • Switchable Graphic Problem AMD & Windows 8.1- Solved

    Follow the steps accurately
    1. Open This Pc or My Computer and then go to Uninstall or change a program
    2. As the list is displayed, you will see Intel Graphic Driver & AMD Catalyst install manager. You have to uninstall it both in express mode so that no other previous setting are available anymore.
    3. First, uninstall Intel Graphics driver. If it asks for a restarting the pc than go for it.
    4. As the list is displayed, you will see AMD Catalyst install manager, right click it and uninstall it in express mode. Uninstall all the AMD component. Restart your PC as it will ask you.
    5. Go to This Pc or My Computer and then C Drive. Open Program Files & Program Files (x86) both of them if you are running 64-bit Os. In the search box write AMD and you will find some remaining files- delete them all.
    6. Now you PC is free of previous drives and the remaining files. Although right click to Windows sign and go to Device Manager. You will see Display adapters and uninstall them both. This step is not necessary but just to be sure that your PC has no previously installed drivers.
    7. Open your browser and download the latest Intel Graphics Driver for your PC. My driver was Win64_153322. Install it. If you install it correctly than you are half way through. Restart your PC if it requires.
    8. Go to AMD web site and download the latest driver. To avoid complicacy best option is to download Autodetect. Because it will choose the best appropriate driver for your system. File name is amddriverdownloader.
    9.  Open the file amddriverdownloader and download the driver. Download will be completed and it will start automatically the installation. Install it in express mode. Restart your PC as it will ask you to do it.
    10. Hopefully your driver problems will be solved. To check it go to device manager and see if the drivers are installed correctly. Turn on CCC and give it a try to play a game in High Performance. You will see the problem is solved.
    This is how I solved my AMD graphics problem. I been suffering since I installed Windows 8.1 just after it was released and today 15 Jun 14 I solved the issue. I can play any game in High performance now.
    If you think my opinion is helpful to you than Please share it.
    Liyad Salem Mridu.
    Please hit Kudos, if I help you!

    hey , can u help me ? i am having the same problem

  • How to add an image/graphic to a form webpage?

    Dear All,
    When we execute our Oracle Forms application, it opens in a webpage with a white background. This looks too bland.
    Is there a way we can add an image/graphic to the webpage to improve its look and feel? Please suggest.
    Thanks,
    Amit

    Hello,
    You have two tags in the /forms/server/formsweb.cfg file to put images in the background:
    splashScreen=no
    background=noreplace the NO value by a .GIF or JPG existing file name on the server.
    You can also hide the blank page (when separate frame=yes) as soon as it dosplays with the following in your concerned section:
    HTMLbodyAttrs=onLoad='javascript:self.moveTo(2000,2000)'Francois

  • Graphic Problem in OS X Mavericks?

    well, i upgraded my machbook pro 15' to OS X Mavericks and now have been encountering graphic problems.
    This is the Do Not Disturb part in my notification center.
    Any Solution?
    Regards,

    You could try booting into Safe Mode. If all seems fine in Safe Mode, restart normally and see if it helped.

Maybe you are looking for

  • Delete File's after Reading on server

    Hi All, I am uploading & reading a CSV or Txt file which contains data. The servlet reads & successfully inserting date into the backend db tables. For the uploading purposes i am using com.oreilly.servlet.MultipartWrapper servlet class which does su

  • Calculation in Webi Report

    Hi Experts , I want to show the result calculation of a Webi Report (derived from Bex query which uses %YT in CKF) . Since BO doesn't support %YT so I am creating the dynamic calculation in Webi : Scenario : Data in Report is like this : If in select

  • PDF not showing at actual size

    I have a website mockup design (72dpi) created in Fireworks. I often provid these for client review as PDFs. However, recently, the PDFs are not displaying properly. I've tried various ways of creating the PDFs: place Fireworks png in InDesign, open

  • Do you have to implement SRM to use the self service procurement?

    I was interested in possibly using the self service procurement functionality. Do you have to implement SRM for this to be available? Thanks! Chris Lintner Aflac

  • Help getting .mov off of new 3gs iphone windows

    Is there a way to get the videos u take off of the new iphone on a windows pc. I see lots of post for mac users but non for pc users. Any help please. Is there any good software out there or a workaround. Thank you in advance.