CGraphCtx.DrawBitmapmethod
Draws a bitmap in the Graphic Control.
Syntax
SUB DrawBitmap (BYVAL hbmp AS HBITMAP, BYVAL x AS SINGLE = 0, BYVAL y AS SINGLE = 0, BYVAL nRight AS SINGLE = 0, BYVAL nBottom AS SINGLE = 0) AS GpStatus
SUB DrawBitmap (BYVAL pBitmap AS GpBitmap PTR, BYVAL x AS SINGLE = 0, BYVAL y AS SINGLE = 0, BYVAL nRight AS SINGLE = 0, BYVAL nBottom AS SINGLE = 0) AS GpStatus
SUB DrawBitmap (BYREF pMemBmp AS CMemBmp, BYVAL x AS SINGLE = 0, BYVAL y AS SINGLE = 0, BYVAL nRight AS SINGLE = 0, BYVAL nBottom AS SINGLE = 0) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
hbmp | A handle to the bitmap. | |
pBitmap | Pointer to a GDI+ bitmap. | |
pMemBmp | Reference to a memory bitmap (CMemBmp class). | |
x | Optional. Left position. | |
y | Optional. Top position. | |
nRight | Optional. Right position.. | |
nBottom | Optional. Bottom position.. |
Return value
Returns OK (0) on success or a GdiPlus status code on failure.
Description
Draws a bitmap in the Graphic Control.
Remarks
If both x and y are ommited, the image is draw starting at position 0, 0.
If nRight and nBottom are specified, the image is draw stretched in the bounding rectangle formed by x, y, nRight and nBottom.
Example
DIM pMemBmp AS CMemBmp = CMemBmp($"C:\Users\Pepe\Pictures\Cole_Kyla_01.jpg") Rectangle pMemBmp.GetMemDC, 10, 10, 150, 150 LineTo pMemBmp.GetMemDC, 30, 180 pGraphCtx.DrawBitmap pMemBmp
Reference
- Include file
CGraphCtx.inc - Defined in AfxNova/CGraphCtx.inc:1046
- Documented in Graphics/CGraphCtx Class.md
- Topic: CGraphCtx Class