Jump to content

GrePaintRegion: Difference between revisions

From EDM2
Created page with "GrePaintRegion paints the specified region by using the current area foreground and background colors. This function can be hooked by the presentation driver. ;Simulation ..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GrePaintRegion paints the specified region by using the current area foreground and background colors.  
GrePaintRegion paints the specified region by using the current area foreground and background colors.


This function can be hooked by the presentation driver.  
This function can be hooked by the presentation driver.


;Simulation support: This function is simulated by a handling routine in the graphics engine.  
;Simulation support: This function is simulated by a handling routine in the graphics engine.


==Syntax==
==Syntax==
  GrePaintRegion(hdc, hrgn, pInstance, lFunction);
  GrePaintRegion(hdc, hrgn, pInstance, lFunction)


==Parameters==
==Parameters==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;hrgn (HRGN) - input:Region handle.
 
;pInstance (PVOID) - input:Pointer to instance data.
;hrgn (HRGN) - input  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGrePaintRegion.
:Region handle.  
 
;pInstance (PVOID) - input  
:Pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGrePaintRegion.  


==Return Code==
==Return Code==
;rc (LONG) - returns  
;rc (LONG) - returns:Return codes.
:Return codes.  
:This function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected:
 
:*GPI_OK Successful
:This function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected:  
:*GPI_HITS Successful with correlate hit (returned by display drivers when the correlate flag is ON, and a hit is detected)
 
:*GPI_ERROR Error
:*GPI_OK Successful  
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
:*GPI_HITS Successful with correlate hit (returned by display drivers when the correlate flag is ON, and a hit is detected)  
:*PMERR_HDC_BUSY
:*GPI_ERROR Error  
:*PMERR_HRGN_BUSY
 
:*PMERR_INV_HDC
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:  
:*PMERR_INV_HRGN
 
:*PMERR_INV_IN_AREA
:*PMERR_HDC_BUSY  
:*PMERR_INV_IN_PATH
:*PMERR_HRGN_BUSY  
:*PMERR_REGION_IS_CLIP_REGION
:*PMERR_INV_HDC  
:Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation.
:*PMERR_INV_HRGN  
:*PMERR_INV_IN_AREA  
:*PMERR_INV_IN_PATH  
:*PMERR_REGION_IS_CLIP_REGION  
 
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.  


==Remarks==
==Remarks==
Mixing is controlled only by the area foreground mix. GrePaintRegion returns an error when the region is currently selected as a clip region.  
Mixing is controlled only by the area foreground mix. GrePaintRegion returns an error when the region is currently selected as a clip region.


If the preprocessor in the graphics engine receives a GrePaintRegion call for a null region, the preprocessor returns GPI_OK and does not forward the call through the dispatch table to the handling routine. Presentation drivers for devices that do not support BitBlt operations (for example, vector devices such as plotters) do not hook this function. Such drivers hook only the function to return an error code.  
If the preprocessor in the graphics engine receives a GrePaintRegion call for a null region, the preprocessor returns GPI_OK and does not forward the call through the dispatch table to the handling routine. Presentation drivers for devices that do not support BitBlt operations (for example, vector devices such as plotters) do not hook this function. Such drivers hook only the function to return an error code.


==Declaration==
==Declaration==
Line 59: Line 46:
LONG    rc;        /*  Return codes. */
LONG    rc;        /*  Return codes. */


rc = GrePaintRegion(hdc, hrgn, pInstance,
rc = GrePaintRegion(hdc, hrgn, pInstance, lFunction);
      lFunction);
</PRE>
</PRE>


[[Category:Gre]]
[[Category:Gre]]

Latest revision as of 23:00, 24 March 2020

GrePaintRegion paints the specified region by using the current area foreground and background colors.

This function can be hooked by the presentation driver.

Simulation support
This function is simulated by a handling routine in the graphics engine.

Syntax

GrePaintRegion(hdc, hrgn, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
hrgn (HRGN) - input
Region handle.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGrePaintRegion.

Return Code

rc (LONG) - returns
Return codes.
This function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected:
  • GPI_OK Successful
  • GPI_HITS Successful with correlate hit (returned by display drivers when the correlate flag is ON, and a hit is detected)
  • GPI_ERROR Error
Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
  • PMERR_HDC_BUSY
  • PMERR_HRGN_BUSY
  • PMERR_INV_HDC
  • PMERR_INV_HRGN
  • PMERR_INV_IN_AREA
  • PMERR_INV_IN_PATH
  • PMERR_REGION_IS_CLIP_REGION
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Remarks

Mixing is controlled only by the area foreground mix. GrePaintRegion returns an error when the region is currently selected as a clip region.

If the preprocessor in the graphics engine receives a GrePaintRegion call for a null region, the preprocessor returns GPI_OK and does not forward the call through the dispatch table to the handling routine. Presentation drivers for devices that do not support BitBlt operations (for example, vector devices such as plotters) do not hook this function. Such drivers hook only the function to return an error code.

Declaration

#define INCL_GRE_REGIONS
#include <os2.h>

HDC      hdc;        /*  Device context handle. */
HRGN     hrgn;       /*  Region handle. */
PVOID    pInstance;  /*  Pointer to instance data. */
ULONG    lFunction;  /*  High-order WORD=flags; low-order WORD=NGrePaintRegion. */
LONG     rc;         /*  Return codes. */

rc = GrePaintRegion(hdc, hrgn, pInstance, lFunction);