BUG: PaintEvent.clipRect Does Not Return Clip Area Width/Height (220592)



The information in this article applies to:

  • Microsoft Visual J++ 6.0

This article was previously published under Q220592

SYMPTOMS

When you use the Windows Foundation Classes for Java PaintEvent class, the member variable called clipRect erroneously returns the lower-right corner of the clip area instead of the width and height of the clip area in its member variables "width" and "height".

RESOLUTION

Make sure that any code that uses clipRect also uses the member variables named "width" and "height" as if they were named "right" and "bottom", respectively.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. In Visual J++ 6.0, create a new Windows Application project.
  2. Add a paint event handler by opening the Properties window, double-clicking the form to display the display the form's properties in the Properties window, opening the event list, and double-clicking the paint entry.
  3. Add System.out.println(e.clipRect); to the new method.
  4. Debug the application.
  5. Cover only the lower-right corner of the form with another window, such as Notepad.
  6. Click on the form to bring it to the front.


RESULT: The output for a form that is 300 pixels wide and 275 pixels high should be like the following:
{x=202,y=153,width=300,height=275}
				
If the entire client area of the same form is repainted, you should see the following:
{x=0,y=0,width=300,height=275}
				



Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbWFC KB220592