Re: Rubber Band Box Over Tiff

From: Michael Borgwardt (brazil_at_brazils-animeland.de)
Date: 12/30/03


Date: Tue, 30 Dec 2003 19:39:44 +0100

Mike wrote:

> I am trying to create a rubber band box over a tiff image. I am
> currently using a tiledimage and also using getGraphics(). I can get
> the rectangle to be drawn with the mouse, but I cannot get the
> previous lines to erase, so eventually the screen will all turn black
> if I keep moving the mouse around. I can redraw the lines in
> white.... but how do I redraw them with the actual image?

Assuming that you're using Swing:
Don't draw the box directly on the image, draw it on an otherwise
transparent component on top, i.e. use a JLayeredPane or (if
the layout is simple enough) the GlassPane of the JFrame.



Relevant Pages

  • Re: What property defines a controls paint bounds?
    ... And you need to subtract one from the width and height to get the whole rectangle to draw. ... A line drawn from to for example will fill all of the pixels just to the right of that 0-width vertical line between those coordinates, inclusive. ...
    (microsoft.public.dotnet.languages.csharp)
  • MFC: How to draw a semi-transparent shape?
    ... I am using Microsoft visual c++ 6, and I want to draw a shape (say a ... rectangle) on a view. ... CRect rec; ... //rectangle to be drawn ...
    (comp.lang.cpp)
  • Drawing on PictureBox
    ... I draw a rectangle on the PictureBox: ... When i minimize the form and restore again, i loose all i've drawn. ... In what event handler i need to redraw the rectangle? ... I tried to call the draw function in PictureBox.Paint - doesn't work. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Drawing on PictureBox
    ... I draw a rectangle on the PictureBox: ... When i minimize the form and restore again, i loose all i've drawn. ... In what event handler i need to redraw the rectangle? ... I tried to call the draw function in PictureBox.Paint - doesn't work. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • cubes + clear black edges
    ... basically I want to draw a set of cubes, e.g. in red, and redraw the ... so on, that was all easy, I draw a set of lines after the cubes around ... disapear if one cube is close to be in front of a line to be drawn. ...
    (microsoft.public.win32.programmer.directx.managed)