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

ID: Q220592


The information in this article applies to:


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 this to be a bug in the Microsoft products 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} 


© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Joseph B. Hall, Microsoft Corporation

Additional query words: PaintEvent clipRect width height right bottom


Keywords          : kbSDKJava kbVJ600bug kbWFC kbGrpJava 
Version           : WINDOWS:6.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: March 18, 1999