WinInvertRect: Difference between revisions
Appearance
Created page with "Posts a message to the message queue associated with the window defined by hwnd. == Syntax == WinInvertRect(hps, prclRect) == Parameters == ; hps (HPS) - input : Presentation-space handle. : The presentation space contains the rectangle to be inverted. ;prclRect (PRECTL) - input : Rectangle to be inverted. : Note: The value of each field in this structure must be in the range -32 768 through 32 767. The data type WRECT can also be used, if supported by the language...." |
|||
Line 67: | Line 67: | ||
* [[WinFillRect]] | * [[WinFillRect]] | ||
* [[WinGetSysBitmap]] | * [[WinGetSysBitmap]] | ||
* [[WinQueryPresParam]] | * [[WinQueryPresParam]] | ||
* [[WinRemovePresParam]] | * [[WinRemovePresParam]] |
Latest revision as of 02:43, 9 April 2025
Posts a message to the message queue associated with the window defined by hwnd.
Syntax
WinInvertRect(hps, prclRect)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- The presentation space contains the rectangle to be inverted.
- prclRect (PRECTL) - input
- Rectangle to be inverted.
- Note: The value of each field in this structure must be in the range -32 768 through 32 767. The data type WRECT can also be used, if supported by the language.
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE
- Successful completion
- FALSE
- Error occurred.
Remarks
Inversion is a logical-NOT operation and has the effect of flipping the bits of each pel.
Example Code
#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, */ #include <os2.h> HPS hps; /* Presentation-space handle. */ PRECTL prclRect; /* Rectangle to be inverted. */ BOOL rc; /* Success indicator. */ rc = WinInvertRect(hps, prclRect);
This example inverts a rectangle if the mouse button is released (WM_BUTTON1UP) within the rectangle (WinPtInRect); the presentation space handle is obtained via WinBeginPaint.
#define INCL_WINWINDOWMGR /* Window Manager Functions */ #include <os2.h> BOOL fSuccess; /* success indicator */ HAB hab; /* anchor-block handle */ RECTL prclRect1 = {0,0,100,100}; /* rectangle */ HWND hwnd; /* client window handle */ HPS hps; /* presentation-space handle */ POINTL ptl; /* current mouse position */ MPARAM mpParam1; /* Parameter 1 (x,y) point value */ case WM_BUTTON1UP: ptl.x = (LONG) SHORT1FROMMP(mpParam1); ptl.y = (LONG) SHORT2FROMMP(mpParam1); if (WinPtInRect(hab, &prclRect1, &ptl)) { hps = WinBeginPaint(hwnd, NULLHANDLE, &prclRect1); fSuccess = WinInvertRect(hps, &prclRect1); WinEndPaint(hps); }