Painting on Top of Image

I'm trying to design an applet which simulates a radar screen. Although I'm a novice, I have managed to create the radar itself OK.
However, I would like the radar screen to "sit" on a "console", and I'm trying to use an image file as this background console. Although the image loads and displays AOK, I can't seem to draw the radar on top of it.
I have tried using both the Image and Graphics objects, for example:
public class radar extends Applet implements Runnable {
private Image img;
private Graphics buffer;
// First get the 'console' image... this works AOK....
buffer=getImage(getDocumentBase(),"ar200.png");
// Now I need to paint the radar screen on top of the
// image, but it applet won't work when I add...
buffer=img.getGraphics();
// I've used getGraphics separately - without preloading
// an image - to create the animated radar screen, which
// works AOK, for example:
public void paint(Graphics g) {
// Set the radar screen grid circles
buffer.setColor(Color.gray);
buffer.drawOval(0, 0, aW, aH);
buffer.drawOval(aW/2/4*1, aH/2/4*1, aW/4*3, aH/4*3);
buffer.drawOval(aW/2/4*2, aH/2/4*2, aW/4*2, aH/4*2);
buffer.drawOval(aW/2/4*3, aH/2/4*3, aW/4*1, aH/4*1);
.... etc
g.drawImage (img,0,0,this);
.... etc
So, I can display an imported "console" image file, OR draw and display an animated radar screen - but not both! I think it might be an issue with combining "on-screen" and "off-screen" painting, but I'm not at all sure.
If anyone could suggest the method to accomplish this, or point me to an online resource that I can study, I'd really appreciate it.
MTIA, Max

// Now I need to paint the radar screen on top of
of the
// image, but it applet won't work when I add...
buffer=img.getGraphics();
I am surprised that this line above compiled. I don't think you can load an image and get its graphics directly. You can get graphics of an image only if it is created by the component. What you need is to create an image (off-screen), draw everything (background image and radar) on it and copy it to on-screen.
On top of my head, here is a code for your applet to do this stuff:
Image off, back;
Graphics offG;
public void init()
// create your offscreeen image
off = createImage(getSize().width, getSize().height);
offG = off.getGraphics();<br>
// load your background image
back = getImage(getDocumentBase(),"ar200.png");
public void paint(Graphics g)
// draw everything to your off screen first
offG.drawImage(back, 0, 0, this);
// draw your radar on top of it.
offG.setColor(Color.gray);
//...other radar stuff
// copy your off screen to on screen now
g.drawImage(off, 0,0, this);
}ibosan

Similar Messages

  • How to Paint the Presenter desktop images in participant application?

    Hi everybody,
    I have one doubt
    how to paint the Presenter desktop image in the participant
    application?
    In the breeze doing great work
    Please tell me how its possible
    Thanks and regards
    Flashgroups

    Hi John:
    If I understand your question correctly, this is something
    you can do
    in a Breeze meeting. Within the meeting, you would need to
    open a
    share pod and choose to share your screen. Once your screen
    is being
    shared, you can click on the right hand corner menu and
    choose
    "Whiteboard overlay". Then presenters, hosts, and
    participants with
    enhanced share pod priveleges will be able to "paint on top
    of" the
    desktop image (whatever application you're sharing).
    Hope this helps!
    Jeff Von Ward
    Manager, Breeze Product Support
    Adobe Systems, Inc.
    On Thu, 22 Jun 2006 09:36:40 +0000 (UTC), "johnentry"
    <[email protected]> wrote:
    >Hi everybody,
    > I have one doubt
    > how to paint the Presenter desktop image in the
    participant application?
    > In the breeze doing great work
    > Please tell me how its possible
    > Thanks and regards
    > Flashgroups

  • Adobe Bridge displays icons on top of image in Full screen view

    Icons like RAR, txt files if any in that folder. Bridge 4.0.5.11 Windows XP SP3.

    Do you mean option sort By Filename, By Type and so on..
    This does not solve the problem, still icon appear on top of image
    Anyway, my idea is not to complain but to report this issue. I can live with that.
    Message was edited by: Bojan Živković

  • Windows 8, Lightroom 5.6. When i enable filters to search. It cuts off the top 160  images. These images are NOT included in the search!!

    In Windows 8, Lightroom 5.6. The search/filter function cuts off the top 160+ images. These are NOT included in the search.
    Even when there are as little as 6 images it does not include the first 4 images.
    I found this when I was searching a particular ISO. It did not show in the metadata search. I knew there were over 60 images at that ISO.
    I tried a text search, it did not work either. The top 160+ images were left out.
    Also it renumbered the images. My image number was #163 but Lightroom said it was #1.
    In Windows 7 Enterprise, Lightroom 5.6 worked perfectly.

    We'll need more detail to figure out what's going on. While we could play twenty questions, the most efficient way to troubleshoot this is to start out by posting a full-resolution screen shot of your LR window.

  • Responsive design top logo image

    I have problems with my responsive design: top logo image doesn't follow the various widths. Fex. the mobile display width or the maximum width display. I've tried to fix this by adding a srcset with tree different image sizes but that does't work either. The fluid grid template is DW:s own, it's the latest version of DW from Creative Cloud.
    These are my two attempts:
    <header class="fluid" id="logga"><img src="Images/Logga4.jpg" srcset="Images/logga1 300w, Images/logga2 650w, Images/logga3 1150w" alt="Logga"/></header>
    and the one without srcset: <header class="fluid" id="logga"><img src="Images/Logga4.jpg" alt="Logga"/></header>
    Any ideas?

    See if this live example helps you.  I have 3 different images -- desktop, tablet and mobile.
    Alt-Web :: Fluid Grid Test #4
    Relevant CSS code:
    /**for desktop**/
    .desktop {display:block;}
    .mobile, .tablet {
        display:none;
    /* Special Rules for tablets */
    @media only screen and (max-width: 768px) {
        .desktop, .mobile {display:none}
        .tablet {display:block}
    /* Special Rules for mobiles */
    @media only screen and (max-width: 480px) {
        .desktop, .tablet {display:none}
        .mobile {display:block}
    Relevant HTML code:
         <div class="gridContainer clearfix">
         <img class="banner desktop" src="http://placehold.it/1056x200/198EBA/FFFFFF&text=DESKTOP.jpg" alt="desktop image" />
         <img class="banner tablet" src="http://placehold.it/800x100/2A4D6B/FFFFFF&text=TABLET.jpg" alt="tablet image" />
         <img class="banner mobile" src="http://placehold.it/320x75/FFC000/000000&text=MOBILE.jpg" alt="mobile image" />
    </div>

  • Converting Word to PDF: text doesn't show on top of image

    I have a word 2013 document with text on top of an image. When I convert to PDF with Acrobat Standard XI the image covers the text.
    Here is the page in Word:
    and here in Acrobat:
    Any help would be appreciated!

    I have only used Acrobat Pro, not Standard. Does Standard have a Content Pane? If so, I would try selecting each content element on the page till I found the image, and drag it above the text elements in the content order.
    Hope this helps.
    a 'C' student

  • Getting text to appear on top of Image In InDesign 5

    I am struggling to get some text to appear on top of an image in InDesign 5. I did fiddle with layers but it doesn't appear to have multiple layers.
    Could someone walk me through making this work?
    Appreciate the help!
    Brian

    It seems that even if I turn the image off in layers, the text fiend does not sho up. In other words, if I create a text field outside the printable area for the boot, the text is displayed, but when I drag it into the printable area, the text goes blank.
    Let me get this one thing straight though: But draging the text layer entry above the image layer entry, the text layer would thus be above and on top(visable).??
    But it's not working as a result of the above mentioned. I still seems to have something to do with the image layer that exists on the page.
    Ooops! Bob, you hit the nail on the head. Although there was no text wrap spacing added, the text wrap was on. So, selecting a particular image and removing "text wrap" only applies the attributes only to that image. All other images still have text wrap on.....which is what I want.
    Thanks to all.

  • Novice.... cannot create a floating div on top of image for my paragraph

    how can i insert a section of writing over the top of my image? below is obviously what i have for my image,
    <img src="images1/logo.jpg" alt="" width="1000" height="418" class="logo" /><br />
    i need a paragraph of text to go over the top of that, but when i insert a new ap div it goes above that or below that i need it to float over the top.
    the easier option i feel is with the image im using is just to type the text in the image, but i fear this is bad designing and it would not display correctly with certain browsers?? am i correct
    because i am new to this whole thing i am struggling to find the right words to explain this, i hope this makes sense.

    ok this is my html im amazed i have got this far, the reason im struggling is because my idea has changed halfway through and im struggling to remember what to put where to achieve what i want,
    now then where i have inserted an image width 523 height 418 leaves a gap beside it which is 477 i need to fill that 477 gap with 2 divs (boxes) 1 on top of the other the top box will have an image, the box below that will have some text. this is where i am now stuck,
    i have attached a jpeg image to this reply so you can see how the website has layed out so far, the red box i have highlighted in the jpeg is what i am trying to achieve, can you tell me what i need to put where to achieve that?
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title></title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <link href="layout.css" rel="stylesheet" type="text/css" />
    <script src="maxheight.js" type="text/javascript"></script>
    </head>
    <body id="index_1" onload="new ElementMaxHeight();">
    <div id="main">
    <!--header -->
    <div id="header">
    <div class="menu">
    <ul>
    <li><a href="index.html">Home page</a></li>
    <li class="active"><a href="index-1.html">About Us</a></li>
    <li><a href="index-2.html">Gallery</a></li>
    <li><a href="index-3.html">Services</a></li>
    <li><a href="index-4.html">Articles</a></li>
    <li class="last"><a href="index-5.html">Contact us</a></li>
    </ul>
    </div>
    <img src="images1/islandlogo.jpg" alt="" width="523" height="418" class="logo" /><br />
    </div>
    <!--header end-->
    <div id="middle">
    <div class="container">
    <div class="column1 maxheight">
    <div class="indent">
    <div class="title1">
    <div class="inner">
    <h2>Biography</h2>
    </div>
    </div>
    <div class="content">
    <a href="#" class="fs14">Sed ut perspiciatis undesuser lerase</a><br />
    Lum mleie kertase miaserillus lerasert sere nertas um sociis natotdisrie jertas leraaerts keyuaroonec accnec porta ter.<br />
    <div class="imgtext">
    <img alt="" src="images1/page2_img1.jpg" class="imgindent" />
    <ul>
    <li><a href="#"></a></li>
    <li><a href="#"></a></li>
    <li><a href="#"></a></li>
    <li><a href="#"></a></li>
    <li><a href="#"></a></li>
    </ul><br class="clear" />
      </div>
      </div>
    </div>
    </div>
    <div class="column2 maxheight">
    <div class="indent2">
    <div class="title2">
    <div class="inner">
    <h2>My Experience</h2>
    </div>
    </div>
    my experience to go in here
    <div class="container">
    <ul class="col1">
    <li><a href="#"></a></li>
    <li><a href="#"></a></li>
    <li><a href="#"></a></li>
    </ul>
    <ul class="col2">
    <li><a href="#"></a></li>
    <li><a href="#"></a></li>
    <li><a href="#"></a></li>
    </ul>
    <br class="clear" />
    </div>
    a brief description here<br />
    <a href="#" class="more">read more</a><div class="clear"></div>
    </div>
    </div>
    <div class="clear"></div>
    </div>
    </div>
    <!--footer -->
    <div id="footer">
    <div class="container">
    <div class="column1">
    up and down &copy; 2008  |  <a href="index-6.html">Privacy policy</a>
    </div>
    <div class="column2">
    <div class="home">21 chapel Street Second Floor<br />
    norwich</div>
      </div>
    <div class="column3">
    <span class="phone">Tel./Fax 01603872094</span>
    </div>
    <br class="clear" />
    </div>
    </div>
    <!--footer end-->
    </div>
    </body>
    </html>

  • Strange behaviour when placing text frame on top of image

    Hi,
    Win XP, FM 8.04
    I have a front cover that consists of a TIF image that bleeds off the page. On top of that image I want to put a text frame with the book title.
    The strange thing is that when I create the text frame and use the toolbar buttons to nudge it down on the page, the text (but not the frame) suddenly jumps to a totally different place way down on the page, despite only nudging it, say, 10 mm.
    Any ideas why this is happening?
    /Mats

    Hi,
    Partly solved:
    After some tests, it seems FM does not like when you try to move a text frame over a transparent area in an image. The image in question was made by importing a PDF into Photoshop, then saving as TIF. Since the PDF contained an area that was had full transparency in InDesign (i.e. "Paper"), that area was also in the TIF image.
    The strange behaviour starts exactly at the border where the transparency starts. In non-transparent areas, there is no problem.
    Seems like a bug.
    /Mats

  • MS Publisher 2013 - Guide lines on top of images

    I am trying to edit a brochure that has a background image and several text and images objects on top.   I am unable to see the guild lines once the background image is added.
    This problem has been around since Publisher 2007 (maybe has always been this way), however, most other design software will allow you to see the guide lines as you work.
    Are there any plans to add this feature to publisher?  
    I found a few articles on the subject and the designers are not happy and switching to other software.   So it may not be a bad idea to add what appears to be a simple improvement to retain and attract users.
    Thanks
    www.mytruebiz.com

    I am trying to edit a brochure that has a background image and several text and images objects on top.   I am unable to see the guild lines once the background image is added.
    This problem has been around since Publisher 2007 (maybe has always been this way), however, most other design software will allow you to see the guide lines as you work.
    Are there any plans to add this feature to publisher?  
    I found a few articles on the subject and the designers are not happy and switching to other software.   So it may not be a bad idea to add what appears to be a simple improvement to retain and attract users.
    Thanks
    www.mytruebiz.com

  • Swf Files in top of Images

    I am fairly new to Dreamweaver so maybe someone knows the answer to this. I downloaded a basic template simply so I would not have to make the backgrounds right away as I am more or less just trying to learn the basics of Dreamweaver to start. I set up all of my images and I wanted to lay a .swf file on top of it. The way I was reading earlier was to go to Insert>Layer Objects>AP Div. I did that and then I selected the new AP Div and did Insert>Media>SWF and chose my swf file. I then moved it to the center of the background and since it was fairly small, i upped the size of the player in the .html code. The issue I am having is I have to move it very far to the right to get it to center on my web browsers. It also doesn't necessarily keep the size I gave it. Once I get it looking correct in my Chrome, it might be positioned drastically in a different browser. On my co-workers computer it is even more drastically different. Anyone have any ideas of how to correct this or a better way to place the .swf on top of another image? I may have done this a very weird way, if that is the case please criticize lol. Your information would be much appreciated.

    We can't see your work (no link provided in your post), so this is a guessing game.
    For basic layouts, the use of APDivs (aka Layers) are not a good choice as they remove content from the normal flow. Misused, APDvis can have horrible consequences as described in the link below:
    http://apptools.com/examples/pagelayout101.php
    For best results, use default CSS positioning (none/static) and learn to use CSS margins, floats and padding to align elements on the page.
    Learn CSS positioning in 10 Steps
    http://www.barelyfitz.com/screencast/html-training/css/positioning/
    Background images should be applied to your body or division with the CSS background property.
         #divName {
         background: url (yourBG-image.jpg) no-repeat
    Then it's a simple matter of inserting regular images, text or media on the page without resorting to APDivs.
    More on using Background images with CSS:
    http://w3schools.com/css/css_background.asp
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • OCR txt on top of image

    I received some PDF's that have the OCR txt on top of the original scan. In the case of some handwritten notes it makes them unreadable. I know that in a normal OCR, the image stays on top and the OCR txt goes behind it.
    How did this happen? and better yet, how do I switch it back?
    For the record, I have never seen this happen.

    To remove the OCR output associated with a PDF -
    (n.b., Not applicable for OCR output of Formated Text & Graphics (Acrobat 8) or ClearScan (Acrobat 9 & X)
    With Acrobat 8 or 9 Pro; use Examine Document. The OCR from Searchable Image or Searchable Image (Exact) is identified as Hidden Text.
    The Examine Document dialog has a "button" to click for removing examination detected.
    With Acrobat X (Pro); use Tools > Protection > Remove Hidden Information.
    Be well...

  • Top of image cut off when printed

    I used Aperture to print a borderless 4x6 on borderless paper. In the print preview, the entire image was there (a close-up of Detroit Tiger Verlander with his hat on). Then I printed and the top 10-20% of his hat was cut off.
    But then I ordered an online print through Aperture of the same photo just as I set up to print from my printer. The print was sent to me without being clipped at the top.
    Anyone know why this clipping happens when I print the picture? I quadruple checked all the settings.

    You may want to check on the printer driver and paper size selected

  • Making a new component paint over top of others.

    Hi,
    I'm trying to make my own custom component (by extending Component). In the paint method, I just would like to draw a rectangle of some size at a certain point on the screen. I want this rectangle to be able to be drawn over top of any components that may already be there, much like a menu is drawn on the screen.
    My question is, how can I do this? Oh, and I'm restricted to the AWT package only (no Swing). What graphics object do I need to do this?
    Thanks in advance!

    you must ensure that your component remains on top of the components you wish to draw over. thats how menus do it. they use a glass pane or some such which is always on top of the other items. This is maintained by the main window the menu is added too. that window knows to always add other things beneath this glass pane which is on top. You should be able to do what you wish.

  • White 'line' at top of images edited in iPhoto '09?

    Hi all,
    I get a (very thin) white line on the top of my images in iPhoto '09. It occurs on some (not all) images when I sharpen them. Anyone have any clues?
    I have posted an example here.
    Note that this does not happen in Aperture 2 but I find iPhoto '09 easier to use.
    Any help?
    All the best
    MacF31

    It's on the first page also. How are you adding the photos to the pages, both album and front? Are you processing the photos in a 3rd party editor?
    Something like this was discussed quite a while a ago. Here is the link to the topic:
    Welcome Page Image Problem
    Message was edited by: Old Toad

Maybe you are looking for

  • How much faster now vs. 4 years ago?

    My computer (Apple iMac Desktop 24" -- 2.8 GHz Intel Core 2 Duo, 2 GB RAM, 320 GB Hard Drive) is coming up on four years old.  I use it extensively for video production, including Final Cut Studio. How much faster will the newest iMac model be (for F

  • Macbook pro switched off won't turn back on

    My mid 2011 macbook pro switched off while I was charging my iphone 5 with it (was using belkin cable since NY apple cable started ripping open at the ends and now it won't work). This happened 2 days ago. I browsed through some of the community memb

  • 890FXA-GD70 Internal Speaker

    I built a computer using this MoBo to run some stock/futures trading software. One of the programs uses the small internal speaker that's connected to the motherboard to emit a single beep when prices change. I DO hear this small speaker "beep" durin

  • Movie rentals on iPads

    I recently rented a movie on my iPad, it was fully downloaded and everything, but when I tried to play it, a message appeared saying, "Could not load video." Help?

  • Time Stamp Field.

    Hi All, I am doing Generic extraction with view for sales order history. Can any body give me the examples of fields names, which could be used in sales orders, and we can use them as time stam fields in generic delta. Regards, Madhu