Mouse moving crosshair over image problem

Hello,
I� am quite a newbe at Java and using the trail and error development method (or copy and paste method) �
Now I� am facing the following problem:
I made a program with an image that is draw out of received data. After that I want to draw a huge cursor crosshair (two lines at image size) over that image. It should move when I move my mouse.
I can�t get it done by redrawing the entire image every mouse motion. That will result in a slow motion crosshair.
The program start with:
public class MyProg extends javax.swing.JFrame {
Container cont;
public byte[] BulkIn = new byte[6000];
public DrawField drawscreen;
public CrossHair crosshair;
/** Creates new form MyProg */
public MyProg() {
drawscreen = new DrawField(BulkIn);
�.
The DrawField part (where the image is drawn) start like:
class DrawField extends JPanel implements Printable {
byte[] BulkData;
Lines BlueLine,RedLine,WhiteLine,GreenLine,CyanLine,YellowLine,OrangeLine,PinkLine;
static BufferedImage imgs;
static BufferedImage raster;
static BufferedImage buffImg;
�..
The CrossHair part starts with:
class CrossHair extends JComponent{
Container cont ;
int x_Pos,y_Pos;
int x_offset,x_end,y_offset,y_end;
public void paint(Graphics g) {
g.setColor(Color.yellow);
g.drawLine(x_offset,y_Pos,x_end,y_Pos);
g.drawLine(x_Pos,y_offset,x_Pos,y_end);
�.
Now, when I reach crosshair.repaint(); nothing happens.
When I change "class CrossHair extends Jcomponent" into "class CrossHair extends Jpanel", the crosshair is drawn perfectly, however, my original image is gone.
My intention was to draw the crosshair on some kind of glasspane, but until now with no success.
Help!

You'll have to redraw everything each time you reposition the cursor.
Your best bet to speed things up (and look nice) are:
1. Use double buffering
2. Redraw only over the area where the cursor needs to first be erased (ie might only be a 30x30 area). You can achieve this by setting the clipping area of the pictures drawn.

Similar Messages

  • Mouse cursor moving mask over another image.

    Hi, Is it possible to have where the Mouse cursor is on the page moving mask over another image. Imagine a black screen with a star cut out of the middle(where the cursor is) and u can see the image behind.
    Any examples on how to do this?
    Can it be done in html instead?

    Create the mask and the background as movieclips and then assign the mask as the mask property of the bacground movieclip... as in background.mask = msk (where msk is the instance name of the mask).
    Then assign a MOUSE_MOVE event listener to the mask and in the event handler for that listener have its x and y properties assigned to be the mouseX and mouseY properties

  • On load button "over" does not work until mouse moved

    hello,
    i have a flash menu that loads from another page. when it
    loads, the users mouse pointer is over one of the buttons. (because
    they just clicked on a button on the past page in that same
    location). the button on the new page does not realize that the
    pointer is over it until the user moves the mouse slightly, then it
    switches to the "over" state. is there a way of letting flash know
    that the mouse is over the button, even though the mouse has not
    moved yet?
    thanks!

    yes, it is a button component. is there a way of letting the
    button know that the mouse is indeed over it, even though the mouse
    has not yet moved? this is a problem on IE, but works fine in
    Safari.
    thanks

  • Metadata ? Login before download? Mouse over image? Three questions...

    Three questions:
    1) Can I add metadata to pages made with iWeb? Does it have to be done in an external application (and if so why)?
    2) I would like to propose a PDF document (a catalogue of services) that can be downloaded from my site but only to visitors who have logged in or at least left their identities (I want to know who has downloaded the catalogue and to be able to contact them afterwards).
    3) I want to have a roll-over image which will show a photograph before and after retouching, switching between the two as the mouse cursor goes over the picture. Can I do this in iWeb?
    Any ideas?
    Many thanks!

    2 - as already suggested you can use a form site to create a form to give you the information you need. DYou can add the form to a web page with an HTML Snippet and iFrame code like in this demo page. The code used is also shown. on't know if you can set it up to download the pdf file but you might be able to add a link to the zipped pdf file which would immediately download the file.
    3 - to do the rollover that you want would require javascript and a snippet. Do a search in this forum for "rollover" and you'll a number of topics where it's discussed. Cyclosaurus is the resident expert on javascript.
    OT

  • I need to attach a pop up or mouse over image to test. How do I go about it?

    I need to attach a pop up or mouse over image to text. How do I go about it?

    Use Tooltips or CSS Disjointed Rollovers.
    http://alt-web.com/DEMOS/CSS-Disjointed-Rollover-1.shtml
    http://alt-web.com/DEMOS/CSS-Disjointed-Image-Rollover.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • HT1436 My Power Mac G5 will not fully boot without safe mode, it only comes to a blue screen where my cursor duplicates in to 2, (one is frozen, one can move by moving the mouse). What is my problem, and how do I fix it?

    My Power Mac G5 will not fully boot without safe mode, it only comes to a blue screen where my cursor duplicates in to 2, (one is frozen, one can move by moving the mouse). What is my problem, and how do I fix it?

    Great clue Lukas...
    One way to test is to Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, Test for problem in Safe Mode...
    PS. Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive
    Reboot, test again.
    If it only does it in Regular Boot, then it could be some hardware problem like Video card, (Quartz is turned off in Safe Mode), or Airport, or some USB or Firewire device, or 3rd party add-on, Check System Preferences>Accounts>Login Items window to see if it or something relevant is listed.
    Check the System Preferences>Other Row, for 3rd party Pref Panes.
    Also look in these if they exist, some are invisible...
    /private/var/run/StartupItems
    /Library/StartupItems
    /System/Library/StartupItems
    /System/Library/LaunchDaemons
    /Library/LaunchDaemons

  • Mouse over images

    How can I create a mouse over image that appears below a navigation/menu button?

    Hello,
    You can have an image filled in the rollover state of the menu item, and that would appear when hovered over the menu item from the front end of the site. Check this related post: http://forums.adobe.com/message/5680522#5680522
    Cheers
    Parikshit

  • Bind a new shortcut to "save an image as" when mouse is hovering over a certain image

    In Opera, if on a page you see several pics, you only need to move mouse pointer to an image you wanna save and press "ctrl+alt+left click" and then a dialogue to save an image pops up.
    I already tried a few addons - none of them did what I need.
    So, I'm tired here a little bit plus... a bit lazy, yeah I could read it all:
    http://developer.mozilla.org/en/docs/XUL_Tutorial:Keyboard_Shortcuts
    http://www-archive.mozilla.org/unix/customizing.html#keys
    But maybe someone who's already prolific on this matter - help me out here? That would be greatly appreciated.

    '''finitarry''', you seem not to haven't read op post attentively, the catch here is how to easily save a certain picture on a page, in another browser you move mouse pointer to a picture and then left click mouse1 + ctrl+alt - then you're popped up to a dialog which asks you where to save the picture.
    In Firefox you have to right click (mouse2) on the picture and then choose "save as", it's not as convenient.

  • Why is the mainscreen/stage moving all over?

    Hello All, it's me Mr. Whinie again with yet anouther "problem"
    CP6 Mac when I duplicate an item or save, the "stage" moves to a different part of the open window, many times leaving only a small bit visible and forcing me to reposition it to see the whole screen. WHY?
    Now for those of you that have messaged me because I'm "whining too much", I have used Adobe products since 1990 and have used numerous versions of all of their programs including Director and Flash and have been a giving comminuty member helping others for pretty much all of those years.
    If you look at my posts the things that I am "whining" about are simple things that should have, IMHO, NEVER made it to a release state. The Groups, constantly expanding in the timeline, the multiple levels of "backgrounds", the seemingly extreme lack of Javascript documentation or even debugging, the inconsistant interface with other Adobe products and now the stage moving all over the place are simply things that should have been addressed.
    I have no problem paying for software, but with the new advent of "cheap" software available, when a company like Adobe charges a premium for software, then IMHO it should be EXTREMELY well tested and documented. They should also allow the purchase of a pervious version for at least 6mo. until all the kinks of the new release are worked out by those that want to fight with the newest release.
    Any insight on how I can stop the above would be welcome.
    Thanx,
    Greg

    Lieve, do you also use an external mouse? If so, you may want to consider trying to configure the laptop so that the touchpad is disabled when the mouse is present. Many laptops will allow you to do that.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • After OS X update moving 1:1 images results in low resolution and a long delay to snap into high res

    After the OS X 10.8.5 update on my current generation 27' iMac moving 1:1 images results in very low resolution for those areas I am moving to with as long as a two second delay before the image snaps back into full resolution. Not only that but when it snaps back into full resolution you see a shift in alignment and a snapping into place with the nearby area that was already in full resolution. This is awful and is occuring with Lightroom 5 and 5.2. Has anyone experienced this?
    My iMacs specs are the current generation 27" iMac, i7 3.4 Ghz, 32GB RAM, and the NVIDIA GeForce GTX 680MX 2GB running OS X 10.8.5.
    I did not have this issue with OS X 10.8.3.

    I have noticed something similar on my Win7x64 system, but am not able to reliably reproduce it. It seems, for me at least, to be a combination of +Clarity and Lens Profile Correction which will always trigger an observable screen redraw when moving from segment to segment in 1:1 view mode. The variable is the delay.....most often it's a fleeting effect, but occasionally there's a more obvious delay in redrawing the image display. I suspect the more obvious delay is, in addition to the +Clarity and Lens Correction, some internal resource utilisation over a longer Lightroom session....certainly every time I've encountered it a Lightroom restart has cleared it up.
    Don't know it that helps, or gives you any pointers to reducing the impact. Because of another "issue" with Lens Corrections (when it's applied, Spot Removal work gets slower), I tend to apply it last of all when editing pictures....so that also helps avoid this 1:1 screen redraw problem.

  • Zooming, scrolling and moving in large images

    I'd like to create a document viewer that works like Google Maps or Safari. Basically the "image" of the document is so big that I only want to load parts of it when the user actually goes over to that part of it.
    How can I enable zooming, scrolling and moving in "large" images like that?
    I looked for a tutorial or sample code, but I wasn't able to find anything.
    Any help would be appreciated,
    -Chris.

    I have 4 Gbyte of RAM. I tried to close every applications but the problem remains. You are right about Web Browser problems but unfortunately my problem is related with Finder windows too. I have 800 Mbyte of free RAM.
    Another fact I can say to you is that when I move Finder window (or other windows as I wrote before) the area outside the border of the window is repainted not well with puzzle effect. I think the problem is related to desktop refresh and repaint. It seems that graphic acceleration doesn't work for some window!!!!

  • Over image not working in Nav Bar

    I have established Up and Over images for my nav bar. The Up
    image is all that shows -- even when I mouse-over or click on the
    button. Thanks for your help!
    Jim
    "MM_nbGroup('down','group1','WhatWeDo','Images_and_Video/WhatWeDo_Over.gif',1)"
    onmouseover="MM_nbGroup('over','WhatWeDo','Images_and_Video/WhatWeDo_Over.gif','Images_an d_Video/WhatWeDo_Over.gif',1)"
    onmouseout="MM_nbGroup('out')"><img
    src="Images_and_Video/WhatWeDo_Up.gif" alt="Home page link"
    name="WhatWeDo" width="161" height="39" border="0" id="Home"
    onload="" /></a></td>
    </tr>
    <tr>
    <td><a href="whoweare.html" target="_top"
    onclick="MM_nbGroup('down','group1','WhoWeAre','Images_and_Video/WhoWeAre_Over.gif',1)"
    onmouseover="MM_nbGroup('over','WhoWeAre','Images_and_Video/WhoWeAre_Over.gif','Images_an d_Video/WhoWeAre_Over.gif',1)"
    onmouseout="MM_nbGroup('out')"><img
    src="Images_and_Video/WhoWeAre_Up.gif" alt="Who we are navigation
    link" name="WhoWeAre" width="161" height="39" border="0" id="Test"
    onload="" /></a></td>

    I'm sorry to tell you that the first thing you need to do is
    to get rid of
    the method you have used. It's quite antique, and was
    designed for framed
    pages. It adds quite a bit of additional code (some of which
    is invalid) to
    your page than would the alternative of using just ordinary
    image swaps for
    your menu.
    So, just create your menu from the up images in each row, and
    use DW's Swap
    image behavior on each.
    And put some duct tape over this NavBar option so that you
    don't use it
    again!
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "JRStaf4ord" <[email protected]> wrote in
    message
    news:gb85gs$5e$[email protected]..
    >I have established Up and Over images for my nav bar. The
    Up image is all
    >that
    > shows -- even when I mouse-over or click on the button.
    Thanks for your
    > help!
    >
    > Jim
    >
    >
    >
    "MM_nbGroup('down','group1','WhatWeDo','Images_and_Video/WhatWeDo_Over.gif',1)"
    >
    onmouseover="MM_nbGroup('over','WhatWeDo','Images_and_Video/WhatWeDo_Over.gif','
    > Images_and_Video/WhatWeDo_Over.gif',1)"
    > onmouseout="MM_nbGroup('out')"><img
    > src="Images_and_Video/WhatWeDo_Up.gif" alt="Home page
    link"
    > name="WhatWeDo"
    > width="161" height="39" border="0" id="Home" onload=""
    /></a></td>
    > </tr>
    > <tr>
    > <td><a href="whoweare.html" target="_top"
    >
    onclick="MM_nbGroup('down','group1','WhoWeAre','Images_and_Video/WhoWeAre_Over.g
    > if',1)"
    >
    onmouseover="MM_nbGroup('over','WhoWeAre','Images_and_Video/WhoWeAre_Over.gif','
    > Images_and_Video/WhoWeAre_Over.gif',1)"
    > onmouseout="MM_nbGroup('out')"><img
    > src="Images_and_Video/WhoWeAre_Up.gif" alt="Who we are
    navigation link"
    > name="WhoWeAre" width="161" height="39" border="0"
    id="Test" onload=""
    > /></a></td>
    >

  • Making FCP stop moving everything over once I put it in the timeline

    Is there anyway to make final cut stop moving EVERYTHING over in my sequence if I insert another audio file or video file?

    You might be doing in insert edit when you want to do an overwrite edit.
    Try dragging an audio or video clip from the browser to an edit point
    on a track with a bunch of stuff on it. Before letting go of the mouse button, notice:
    When the cursor is in the upper third of the track, it looks like a little arrow
    pointing the right, indicating that everything will be moved to the right
    when you insert the clip.
    When the cursor is in the lower two-thirds of the track, it looks like a little arrow
    pointing down, indicating that everything will stay where is, but the clip
    will overwrite the clips you're dragging it onto.
    Hope that helps,
    Les

  • Translucent gray over image in thumbnil (grid) view

    See example image below:
    one thumbnail looks OK (on left), but other, problem image (on right) has translucent gray layer over image!
    The problem images are not in a stack.
    If I click the problem image thumbnail it looks normal, but the gray overlay re-appears if I click on anther image.
    It shows OK in develop module.
    I know this is probably something stupid, but...can anyone help identify what is happening?
    -Colin

    Most probably you have flagged the image as "rejected" by pressing "X" on your keyboard.
    When an image is flagged as rejected it gets that grey overlay that disappears when you select the image. You can still edit them in the Develop Module.
    To delete the "Rejected" flag, select the images with the grey overlay and press "U" or "P" on your keyboard. "U" stands for "Unflagged". "P" stands for "Picked".

  • White Balance Selector Disappears when moved across the image

    Hi
    I am using LR 4.4 on an iMac.
    Does anyone know why the White Balance Selector tool would disappear when moved across an image?
    it seems to change to a vertical line with an arror top and bottom.
    The areas of the image on which it disappears seem to be consistent, in other words, it disappears on the same portion of the image eveytime.
    UPDATE: Since posting the above a few minutes ago I've noticed that my cursor is behaving eractically. For example, on a different image to the one used above, in the library module using the Loupe the cursor changes from a magnifying glass to an arrow pointing to the right.  It does this on the same part of the image every time.
    Thank you for your help
    Regards
    Message was edited by: iwaddo

    Weird cursor problems are a FEATURE of the APPLE os.
    There are complaints on the APPLE os system website since 2005.
    The last time I checked there were 30 pages of discussions about this on the apple site
    https://discussions.apple.com/community/mac_os/os_x_mountain_lion.
    I don't think APPLE has a clue as to how to fix this. It is seen in many apps, photoshop most commonly, lightroom,textedit,exxcel, and others.
    Pray that something happens in soon to be released 10.8.4.
    vince

Maybe you are looking for

  • When I try to open a downloaded ebook Adobe Digital Editions asks for an unlock code. What is that?

    When I try to open a downloaded ebook Adobe Digital Editions asks for an unlock code. What is that?

  • WRT320N : Keep needing to re-connected wireless lan

    Hi I have a problem with a WRT320N that is wirelessly connected to a windows 7 PC using a WUSB600N network card. As soon as I boot the PC, everything works fine. Then after about 30 secs I lose connection to the router. If I disconnect and re-connect

  • Read(Load)/Write(Save) Problem

    I have a form that is filled out by people and I want to save the information in a text file. I have done that well at least I think with the Save code. My problem is when I go to load the text file (.CMM file for my program), nothing happens but it

  • Iweb hosting ?

    Hello Im new to the discussion boards and im sure someone can help me. I currently have an iweb site hosted with .mac, www.haveringindoorbowls.com yet im considering moving over to a different host, (godaddy.com) however there is two OS types to choo

  • Regarding the date.

    HI All,    I created two user defined fileds, I.e., Date And test Date. As my problem is, I entered first filed I.e, Date.. When i came to second one, press shift+F2 or automaticaly, Show 15th day of what i entered in first field..   I.e, If i entere