Thread View: comp.os.os2.programmer
3 messages
3 total messages
Started by Carlos Rimola
Sat, 25 Aug 1990 00:53
Drawing & Clipping
Author: Carlos Rimola
Date: Sat, 25 Aug 1990 00:53
Date: Sat, 25 Aug 1990 00:53
35 lines
1515 bytes
1515 bytes
A basic (I hope) PM question:
I have an analog clock application that experiences a clipping peculiarity
when it is partly overlayed by a dialog or a pull down menu. eg:
+-------+
|\ | (1)
(2) +======+ |
+======+ |
| \ |
+-------+
(1) is the main window, (2) is a dialog that is partly overlaying the
window, the "\" symbols represent a line that is partly overlayed by
the dialog. The problem is that often the drawing that takes place outside
of the overlayed area (outside not under it) is incorrect. eg:
1) draw a line
2) overlay window with a dialog, partly covering the line
3) erase the line by redrawing it using the background color
4) remove the dialog
At the end of this operation I end up with the line partly erased, the
portion under the dialog is correct but that portion not covered by the
dialog is not. eg:
+-------+
|\ |
| |
| |
| \ |
+-------+
Can someone explain why this is happening and what can be done to fix it?
Re: Drawing & Clipping
Author: ie15
Date: Sat, 01 Sep 1990 16:01
Date: Sat, 01 Sep 1990 16:01
47 lines
2102 bytes
2102 bytes
In article <1385@metaphor.Metaphor.COM>, rimola@solrac.metaphor.com (Carlos Rimola) writes:
> A basic (I hope) PM question:
>
> I have an analog clock application that experiences a clipping peculiarity
> when it is partly overlayed by a dialog or a pull down menu. eg:
>
> +-------+
> |\ | (1)
> (2) +======+ |
> +======+ |
> | \ |
> +-------+
>
> (1) is the main window, (2) is a dialog that is partly overlaying the
> window, the "\" symbols represent a line that is partly overlayed by
> the dialog. The problem is that often the drawing that takes place outside
> of the overlayed area (outside not under it) is incorrect. eg:
>
> 1) draw a line
> 2) overlay window with a dialog, partly covering the line
> 3) erase the line by redrawing it using the background color
> 4) remove the dialog
>
> At the end of this operation I end up with the line partly erased, the
> portion under the dialog is correct but that portion not covered by the
> dialog is not. eg:
>
> +-------+
> |\ |
> | |
> | |
> | \ |
> +-------+
>
> Can someone explain why this is happening and what can be done to fix it?
It depends on how you're getting your PS. If it's during the WM_PAINT you get
after the dialog is moved it is working as designed, probably, since PM
will give you a PS that has a clipping boundry defined by the invalidated
rectange of your window. Therefore your got the PS from WinBeginPaint() and
drew the line. It even worked. But since the clipping rectangle is only
the size of the dialog box that was over your window the bottom and the bottom
segments of the line were not drawn. Does anybody agree with me?
Ken Tabor
UNT
Re: Drawing & Clipping
Author: Carlos Alberto Rimola
Date: Wed, 05 Sep 1990 21:27
Date: Wed, 05 Sep 1990 21:27
57 lines
2910 bytes
2910 bytes
In article <33586.26dfdb60@vaxb.acs.unt.edu- ie15@vaxb.acs.unt.edu writes: -In article <1385@metaphor.Metaphor.COM>, rimola@solrac.metaphor.com (Carlos Rimola) writes: -> A basic (I hope) PM question: -> -> I have an analog clock application that experiences a clipping peculiarity -> when it is partly overlayed by a dialog or a pull down menu. eg: -> -> +-------+ -> |\ | (1) -> (2) +======+ | -> +======+ | -> | \ | -> +-------+ -> -> (1) is the main window, (2) is a dialog that is partly overlaying the -> window, the "\" symbols represent a line that is partly overlayed by -> the dialog. The problem is that often the drawing that takes place outside -> of the overlayed area (outside not under it) is incorrect. eg: -> -> 1) draw a line -> 2) overlay window with a dialog, partly covering the line -> 3) erase the line by redrawing it using the background color -> 4) remove the dialog -> -> At the end of this operation I end up with the line partly erased, the -> portion under the dialog is correct but that portion not covered by the -> dialog is not. eg: -> -> +-------+ -> |\ | -> | | -> | | -> | \ | -> +-------+ -> -> Can someone explain why this is happening and what can be done to fix it? - -It depends on how you're getting your PS. If it's during the WM_PAINT you get -after the dialog is moved it is working as designed, probably, since PM -will give you a PS that has a clipping boundry defined by the invalidated -rectange of your window. Therefore your got the PS from WinBeginPaint() and -drew the line. It even worked. But since the clipping rectangle is only -the size of the dialog box that was over your window the bottom and the bottom -segments of the line were not drawn. Does anybody agree with me? - -Ken Tabor -UNT - I agree with you. I went ahead and put in a WinGetPS call in addition to WinBegPaint and proceeded to perform my drawing operations using the PS handle returned by WinGetPS and the clipping problem went away. I am still a bit confused by how clipping works during a WM_PAINT and why I have not been able to find a discussion of it in the 1.2 PM documents. I am also unsure that the method that I am using to bypass clipping is the correct one to use in this situation.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads