Jump to content

GreGetBitmapParameters: Difference between revisions

From EDM2
Created page with "GreGetBitmapParameters returns, in the buffer addressed by pInfoHd, header information for the specified bit map. This function is supported by the graphics engine. ==Synt..."
 
Ak120 (talk | contribs)
m etwas Sauberkeit
 
Line 1: Line 1:
GreGetBitmapParameters returns, in the buffer addressed by pInfoHd, header information for the specified bit map.  
GreGetBitmapParameters returns, in the buffer addressed by pInfoHd, header information for the specified bit map.


This function is supported by the graphics engine.  
This function is supported by the graphics engine.


==Syntax==
==Syntax==
  GreGetBitmapParameters(hbm, pInfoHd, pInstance, lFunction);
  GreGetBitmapParameters(hbm, pInfoHd, pInstance, lFunction)
 
==Parameters==
==Parameters==
;hbm (HBITMAP) - input  
;hbm (HBITMAP) - input:Bit-map handle.
:Bit-map handle.  
;pInfoHd (PBITMAPINFOHEADER) - input:Pointer to a [[BITMAPINFOHEADER]] or to a [[BITMAPINFOHEADER2]] structure where the returned information is stored.
 
;pInstance (PVOID) - input:Pointer to instance data.
;pInfoHd (PBITMAPINFOHEADER) - input  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreGetBitmapParameters.
:Pointer.
 
:Pointer to a BITMAPINFOHEADER or to a BITMAPINFOHEADER2 structure where the returned information is stored.  
 
:Pointer to a BITMAPINFOHEADER structure:
 
::cbFix Length in bytes of this structure
::cx Bit-map width
::cy Bit-map height
::cPlanes Number of color planes, 1 if standard format
::cBitCount Number of adjacent color bits per pel
 
:Each plane has ((cx*cBitCount+31)/32*4*cy) bytes.
 
:Pointer to a BITMAPINFOHEADER2 structure:
 
::cbFix Length in bytes of this structure.
::cx Bit-map width.
::cy Bit-map height.
::cPlanes Number of color planes, 1 if standard format.
::cBitCount Number of adjacent color bits per pel.
::ulCompression Compression scheme used to store the bit map:
:::BCA_UNCOMP Bit map is uncompressed (the only valid value).
 
::cbImage Length of bit map storage data in bytes. If the bit map is uncompressed, 0 (default) can be specified for this.
 
::cxResolution Horizontal component of the resolution of the target device; that is, the resolution of the device for which the bit map is intended in the units specified by usUnits. This information enables an application to select from a resource group the bit map that best matches the characteristics of the current output device.
 
::cyResolution Vertical component of the resolution of the target device; that is, the resolution of the device for which the bit map is intended in the units specified by usUnits. This information enables an application to select from a resource group the bit map that best matches the characteristics of the current output device.
 
::cclrUsed The number of color indexes from the color table that are used by the bit map. If it is 0 (default), all the indexes are used. If it is nonzero, only the first cclrUsed entries in the table are accessed by the system; further entries can be omitted.
 
::For standard formats with a cBitCount of 1, 4, or 8 (and cPlanes=1), any indexes beyond cclrUsed are not valid. For example, a bit map with 64 colors can use the eight-bitcount format without having to supply the other 192 entries in the color table. For the 24-bitcount standard format, cclrUsed is the number of colors used by the bit map.
 
::cclrImportant Minimum number of color indexes for satisfactory appearance of the bit map. More colors can be used in the bit map. However, it is not necessary to assign them to the device palette. These additional colors can be mapped to the nearest colors available. Zero (default) means that all entries are mapped. For a 24-bitcount standard format, the cclrImportant colors are also listed in the color table relating to this bit map.
 
::usUnits Units of measure of the horizontal and vertical components of resolution:
 
::BRU_METRIC (Default) Pels per meter.
 
::usReserved Reserved field. If present, it must be 0.
 
::usRecording Recording algorithm, the format in which bit-map data is recorded:
:::BRA_BOTTOMUP (Default) Scan lines are recorded from bottom to top.
 
::usRendering Halftoning algorithm used to record bit-map data that has been digitally halftoned:
:::BRH_NOTHALFTONED (Default) Bit-map data not halftoned.
:::BRH_ERRORDIFFUSION Error diffusion or damped error diffusion algorithm.
:::BRH_PANDA Processing algorithm for noncoded document acquisition
:::BRH_SUPERCIRCLE Super circle algorithm
 
::cSize1 Size value 1. If BRH_ERRORDIFFUSION is specified in usRendering, cSize1 is the error damping as a percentage in the range 0 - 100. A value of 100% indicates no damping. A value of 0% indicates that any errors are not diffused.
 
::If the BRH_PANDA or BRH_SUPERCIRCLE is specified, cSize1 is the X-dimension of the pattern used, in pels.
 
::cSize2 Size value 2. If BRH_ERRORDIFFUSION is specified in usRendering, this parameter is ignored. If the BRH_PANDA or :::BRH_SUPERCIRCLE is specified, cSize2 is the Y-dimension of the pattern used, in pels.
 
::ulColorEncoding Color encoding:
:::BCE_RGB (Default) Each element in the color array is an RGB2 data type.
 
::ulIdentifier Reserved for application use.
 
;pInstance ( PVOID) - input  
:Pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreGetBitmapParameters.  
 
 


==Return Code==
==Return Code==
;fSuccess (BOOL) - returns  
;fSuccess (BOOL) - returns:Return codes.
:Return codes.  
:On completion, the handling routine must return BOOLEAN (fSuccess).
 
:*TRUE Successful
:On completion, the handling routine must return BOOLEAN (fSuccess).  
:*FALSE Error
 
:Possible Errors Detected: When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:
:*TRUE Successful  
:*PMERR_BITMAP_IS_SELECTED
:*FALSE Error  
:*PMERR_HBITMAP_BUSY
 
:*PMERR_INV_HBITMAP
:Possible Errors Detected:   When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:  
:Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.
 
:*PMERR_BITMAP_IS_SELECTED  
:*PMERR_HBITMAP_BUSY  
:*PMERR_INV_HBITMAP  
 
:Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.  


==Remarks==
==Remarks==
The header information is returned as a BITMAPINFOHEADER or BITMAPINFOHEADER2 structure and gives details such as the width, height, number of planes, and number of bits per pel.  
The header information is returned as a BITMAPINFOHEADER or BITMAPINFOHEADER2 structure and gives details such as the width, height, number of planes, and number of bits per pel.
 
==Sample Code==
<PRE>
#define INCL_GRE_DEVSUPPORT
#include <os2.h>
 
HBITMAP              hbm;        /*  Bit-map handle. */
PBITMAPINFOHEADER    pInfoHd;    /*  Pointer. */
PVOID                pInstance;  /*  Pointer to instance data. */
ULONG                lFunction;  /*  High-order WORD=flags; low-order WORD=NGreGetBitmapParameters. */
BOOL                fSuccess;  /*  Return codes. */
 
fSuccess = GreGetBitmapParameters(hbm, pInfoHd, pInstance, lFunction);
</PRE>


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

Latest revision as of 08:31, 2 January 2020

GreGetBitmapParameters returns, in the buffer addressed by pInfoHd, header information for the specified bit map.

This function is supported by the graphics engine.

Syntax

GreGetBitmapParameters(hbm, pInfoHd, pInstance, lFunction)

Parameters

hbm (HBITMAP) - input
Bit-map handle.
pInfoHd (PBITMAPINFOHEADER) - input
Pointer to a BITMAPINFOHEADER or to a BITMAPINFOHEADER2 structure where the returned information is stored.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreGetBitmapParameters.

Return Code

fSuccess (BOOL) - returns
Return codes.
On completion, the handling routine must return BOOLEAN (fSuccess).
  • TRUE Successful
  • FALSE Error
Possible Errors Detected: When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:
  • PMERR_BITMAP_IS_SELECTED
  • PMERR_HBITMAP_BUSY
  • PMERR_INV_HBITMAP
Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.

Remarks

The header information is returned as a BITMAPINFOHEADER or BITMAPINFOHEADER2 structure and gives details such as the width, height, number of planes, and number of bits per pel.