|
This is a very useful function.
It can be used for pasting 2D bitmaps on the rendered image
For example an image denoting the health condition of the player
or the existence of ammunition
The function copies a bitmap on the given device context.
Use STATE_utilities_load_bitmap_from_file() to get a handle to the bitmap (HBITMAP)
Use STATE_engine_render_on_dc() to get the device context handle (HDC hdc)
Parameters:
hdc: a handle to the device context. usually you would obtain this
handle from calling hdc=STATE_engine_render_on_dc()
hbm: a HBITMAP handle of the bitmap. you can use
STATE_utilities_load_bitmap_from_file() to get
the handle.
x,y: the coordinate where the bitmap should be placed
bm_stretch_width,
bm_stretch_height: Using these params you can stretch the bitmap
If you dont want to stretch the bitmap give -1
Examples:
A)
Copy the bitmap to the top left corner of the window
STATE_utilities_copy_bitmap_on_dc(hdc, hbm, 0,0, -1,-1);
B)
Copy the bitmap to the top left corner of the window
The bitmap will be stretched to a 100x100 square size (size in pixels)
STATE_utilities_copy_bitmap_on_dc(hdc, hbm, 0,0, 100, 100);
|