Help Center

CGraphCtx.DrawBitmapmethod

Draws a bitmap in the Graphic Control.

GraphicsmethodCGraphCtx.incdocumented

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

NameDescription
hbmpA handle to the bitmap.
pBitmapPointer to a GDI+ bitmap.
pMemBmpReference to a memory bitmap (CMemBmp class).
xOptional. Left position.
yOptional. Top position.
nRightOptional. Right position..
nBottomOptional. 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