MiniGUI API Reference (MiniGUI-Threads)
v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
Example: More...
Macros | |
#define | MLS_BLENDMODE_NONE 0x00 |
#define | LoadBitmap LoadBitmapFromFile |
An alias of LoadBitmapFromFile. More... | |
#define | LoadMyBitmap LoadMyBitmapFromFile |
Alias of LoadMyBitmapFromFile. More... | |
Typedefs | |
typedef BOOL(* | CB_ALLOC_BITMAP_BUFF) (void *context, BITMAP *bmp) |
The type of callback to allocate pixel buffer for BITMAP object. More... | |
typedef void(* | CB_ONE_SCANLINE) (void *context, MYBITMAP *my_bmp, int y) |
The type of scanline loaded callback. More... | |
Functions | |
const MG_EXPORT char *GUIAPI | CheckBitmapType (MG_RWops *fp) |
Check the type of the bitmap in a data source. More... | |
MG_EXPORT BOOL GUIAPI | mlsEnableSlaveScreen (HDC dc_mls, BOOL enable) |
Enable or Disable a MLShadow slave screen. More... | |
MG_EXPORT int GUIAPI | LoadBitmapEx2 (HDC hdc, PBITMAP pBitmap, MG_RWops *area, const char *ext, CB_ALLOC_BITMAP_BUFF cb_alloc_buff, void *context) |
Load a device-dependent bitmap from a general data source. More... | |
static int | LoadBitmapEx (HDC hdc, PBITMAP pBitmap, MG_RWops *area, const char *ext) |
Load a device-dependent bitmap from a general data source. More... | |
MG_EXPORT int GUIAPI | LoadBitmapFromFile (HDC hdc, PBITMAP pBitmap, const char *spFileName) |
Load a device-dependent bitmap from a file. More... | |
MG_EXPORT int GUIAPI | LoadBitmapFromMem (HDC hdc, PBITMAP pBitmap, const void *mem, size_t size, const char *ext) |
Load a device-dependent bitmap from memory. More... | |
MG_EXPORT void GUIAPI | UnloadBitmap (PBITMAP pBitmap) |
Unloads a bitmap. More... | |
MG_EXPORT int GUIAPI | SetBitmapKeyColor (HDC hdc, PBITMAP bmp, Uint8 r, Uint8 g, Uint8 b) |
Set the bitmap color key. More... | |
MG_EXPORT void GUIAPI | ReplaceBitmapColor (HDC hdc, PBITMAP pBitmap, gal_pixel iOColor, gal_pixel iNColor) |
Replaces a specific pixels in a bitmap with another pixel. More... | |
MG_EXPORT void GUIAPI | HFlipBitmap (BITMAP *bmp, unsigned char *inter_buff) |
Horizontal Flip the special Bitmap object. More... | |
MG_EXPORT void GUIAPI | VFlipBitmap (BITMAP *bmp, unsigned char *inter_buff) |
Vertical Flip the special Bitmap object. More... | |
MG_EXPORT void *GUIAPI | InitMyBitmapSL (MG_RWops *area, const char *ext, MYBITMAP *my_bmp, RGB *pal) |
Initializes scanline loader of the MYBITMAP object from a data source. More... | |
MG_EXPORT int GUIAPI | LoadMyBitmapSL (MG_RWops *area, void *load_info, MYBITMAP *my_bmp, CB_ONE_SCANLINE cb, void *context) |
Load MYBITMAP scanlines from a data source one by one. More... | |
MG_EXPORT int GUIAPI | CleanupMyBitmapSL (MYBITMAP *my_bmp, void *load_info) |
Cleanups the scanline loader. More... | |
MG_EXPORT int GUIAPI | LoadMyBitmapEx (PMYBITMAP my_bmp, RGB *pal, MG_RWops *area, const char *ext) |
Load a MYBITMAP object from a data source. More... | |
MG_EXPORT int GUIAPI | LoadMyBitmapFromFile (PMYBITMAP my_bmp, RGB *pal, const char *file_name) |
Load a MYBITMAP object from a file. More... | |
MG_EXPORT int GUIAPI | LoadMyBitmapFromMem (PMYBITMAP my_bmp, RGB *pal, const void *mem, size_t size, const char *ext) |
Load a MYBITMAP object from memory. More... | |
MG_EXPORT void GUIAPI | UnloadMyBitmap (PMYBITMAP my_bmp) |
Unloads a bitmap. More... | |
MG_EXPORT int GUIAPI | SaveMyBitmapToFile (PMYBITMAP my_bmp, RGB *pal, const char *spFileName) |
Saves a MYBITMAP object to a bitmap file. More... | |
MG_EXPORT int GUIAPI | SaveBitmapToFile (HDC hdc, PBITMAP pBitmap, const char *spFileName) |
Saves a BITMAP object to a bitmap file. More... | |
MG_EXPORT BOOL GUIAPI | InitBitmap (HDC hdc, Uint32 w, Uint32 h, Uint32 pitch, BYTE *bits, PBITMAP bmp) |
Initializes a BITMAP object as a normal bitmap. More... | |
MG_EXPORT HDC GUIAPI | InitSlaveScreenEx (const char *name, const char *mode, int dpi) |
Initializes slave screen. More... | |
static HDC | InitSlaveScreen (const char *name, const char *mode) |
Initializes slave screen. More... | |
MG_EXPORT void GUIAPI | TerminateSlaveScreen (HDC hdc) |
Terminates slave screen. More... | |
MG_EXPORT BOOL GUIAPI | InitBitmapPixelFormat (HDC hdc, PBITMAP bmp) |
Initializes the bitmap pixel format information of a BITMAP object. More... | |
MG_EXPORT void GUIAPI | DeleteBitmapAlphaPixel (PBITMAP bmp) |
Deletes the bitmap alpha pixel format information of a BITMAP object. More... | |
MG_EXPORT int GUIAPI | ExpandMyBitmap (HDC hdc, PBITMAP bmp, const MYBITMAP *my_bmp, const RGB *pal, int frame) |
Expands a MYBITMAP object to a BITMAP object. More... | |
MG_EXPORT void GUIAPI | ExpandMonoBitmap (HDC hdc, BYTE *bits, Uint32 pitch, const BYTE *my_bits, Uint32 my_pitch, Uint32 w, Uint32 h, DWORD flags, Uint32 bg, Uint32 fg) |
Convert a mono color MYBITMAP pixel data to a BITMAP pixel data. More... | |
static void GUIAPI | Expand16CBitmap (HDC hdc, BYTE *bits, Uint32 pitch, const BYTE *my_bits, Uint32 my_pitch, Uint32 w, Uint32 h, DWORD flags, const RGB *pal) |
Convert a 16 color MYBITMAP pixel data to a BITMAP pixel data. More... | |
static void GUIAPI | Expand256CBitmap (HDC hdc, BYTE *bits, Uint32 pitch, const BYTE *my_bits, Uint32 my_pitch, Uint32 w, Uint32 h, DWORD flags, const RGB *pal, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT *mybmp) |
Convert a 256 color MYBITMAP pixel data to a BITMAP pixel data. More... | |
MG_EXPORT void GUIAPI | CompileRGBABitmap (HDC hdc, BYTE *bits, Uint32 pitch, const BYTE *my_bits, Uint32 my_pitch, Uint32 w, Uint32 h, DWORD flags, void *pixel_format, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT *mybmp) |
Convert a MYBITMAP pixel data to a BITMAP pixel data. More... | |
MG_EXPORT void GUIAPI | CompileRGBABitmapEx (HDC hdc, BYTE *bits, Uint32 pitch, const BYTE *my_bits, Uint32 my_pitch, Uint32 w, Uint32 h, DWORD flags, void *pixel_format, CB_DRAW_PIXEL cb_draw, MYBITMAP_CONTXT *mybmp, BYTE *alpha_mask) |
Compile a MYBITMAP pixel data to a BITMAP pixel data. More... | |
MG_EXPORT int GUIAPI | PaintImageEx (HDC hdc, int x, int y, MG_RWops *area, const char *ext) |
Paints an image from data source on device directly. More... | |
MG_EXPORT int GUIAPI | PaintImageFromFile (HDC hdc, int x, int y, const char *spFileName) |
Paints an image from file on device directly. More... | |
MG_EXPORT int GUIAPI | PaintImageFromMem (HDC hdc, int x, int y, const void *mem, size_t size, const char *ext) |
Paints an image from memory on device directly. More... | |
MG_EXPORT int GUIAPI | StretchPaintImageEx (HDC hdc, int x, int y, int w, int h, MG_RWops *area, const char *ext) |
Paints an image from data source on device directly. More... | |
MG_EXPORT int GUIAPI | StretchPaintImageFromFile (HDC hdc, int x, int y, int w, int h, const char *spFileName) |
Paints an image from file on device directly. More... | |
MG_EXPORT int GUIAPI | StretchPaintImageFromMem (HDC hdc, int x, int y, int w, int h, const void *mem, size_t size, const char *ext) |
Paints an image from memory on device directly. More... | |
MG_EXPORT void GUIAPI | RotateBitmap (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle) |
Rotate a bitmap object. More... | |
MG_EXPORT void GUIAPI | RotateBitmapVFlip (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle) |
Flips vertically and rotates a bitmap object. More... | |
MG_EXPORT void GUIAPI | RotateBitmapHFlip (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle) |
Flips horizontally and rotates a bitmap object. More... | |
MG_EXPORT void GUIAPI | RotateScaledBitmap (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle, int w, int h) |
Stretches or shrinks a bitmap object at the same as rotating it. More... | |
MG_EXPORT void GUIAPI | RotateScaledBitmapVFlip (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle, int w, int h) |
Flip vertically, rotates, stretch or shrinks a bitmap object. More... | |
MG_EXPORT void GUIAPI | RotateScaledBitmapHFlip (HDC hdc, const BITMAP *bmp, int lx, int ty, int angle, int w, int h) |
Flip horizontaly, rotates, stretch or shrinks a bitmap object. More... | |
MG_EXPORT void GUIAPI | PivotBitmap (HDC hdc, const BITMAP *bmp, int lx, int ty, int cx, int cy, int angle) |
Pivot a bitmap object. More... | |
MG_EXPORT void GUIAPI | PivotScaledBitmapFlip (HDC hdc, const BITMAP *bmp, fixed x, fixed y, fixed cx, fixed cy, int angle, fixed scale_x, fixed scale_y, BOOL h_flip, BOOL v_flip) |
Rotates, stretches or shrinks, flips a bitmap object. More... | |
Example:
#define LoadBitmap LoadBitmapFromFile |
#define LoadMyBitmap LoadMyBitmapFromFile |
#define MLS_BLENDMODE_NONE 0x00 |
This function is used to set attributes of MLShadow slave screen. After creating a slave screen by InitSlaveScreen successfully, you should call this function to set its attributes. When blend_flags is MLS_INFOMASK_ALL, it will set all attributes of slave screen.
dc_mls | The handle to the slave screen. |
mask | The attributes mask, can be or'ed values of the following mask: |
offset_x | The x offset value of slave screen relative to masterscreen. |
offset_y | The y offset value of slave screen relative to masterscreen. |
blend_flags | The blend flags, can be one of the following values: |
color_key | The colorkey value of MLShadow slave screen. |
alpha | The alpha value of MLShadow slave screen. |
z_order | The zorder of MLShadow slave screen. |
typedef void(* CB_ALLOC_BITMAP_BUFF)(void *context, BITMAP *bmp) |
typedef void(* CB_ONE_SCANLINE)(void *context, MYBITMAP *my_bmp, int y) |
const char *GUIAPI CheckBitmapType | ( | MG_RWops * | fp | ) |
Check the type of the bitmap in a data source.
This function checks the type of the bitmap in the data source fp, and returns the extension of this type of bitmap file.
fp | The pointer to the data source. |
int GUIAPI CleanupMyBitmapSL | ( | MYBITMAP * | my_bmp, |
void * | load_info | ||
) |
Cleanups the scanline loader.
This function cleanups the scanline loader.
my_bmp | The pointer to the MYBITMAP object. |
load_info | The initialized information retured by InitMyBitmapSL function. |
void GUIAPI CompileRGBABitmap | ( | HDC | hdc, |
BYTE * | bits, | ||
Uint32 | pitch, | ||
const BYTE * | my_bits, | ||
Uint32 | my_pitch, | ||
Uint32 | w, | ||
Uint32 | h, | ||
DWORD | flags, | ||
void * | pixel_format, | ||
CB_DRAW_PIXEL | cb_draw, | ||
MYBITMAP_CONTXT * | mybmp | ||
) |
Convert a MYBITMAP pixel data to a BITMAP pixel data.
This function Convert a MYBITMAP pixel data to a BITMAP pixel data.
hdc | The device context. |
bits | The BITMAP pixel data(RGBA etc.). |
pitch | The pitch of the BITMAP object. |
my_bits | The MYBITMAP pixel data to be compile. |
my_pitch | The pitch of the MYBITMAP object. |
w | The width of the MYBITMAP object. |
h | The height of the MYBITMAP object. |
flags | The flags of the MYBITMAP object. |
pixel_format | The pixel format of the MYBITMAP object. |
cb_draw | The draw callback function. |
mybmp | The context of cb_draw. |
void GUIAPI CompileRGBABitmapEx | ( | HDC | hdc, |
BYTE * | bits, | ||
Uint32 | pitch, | ||
const BYTE * | my_bits, | ||
Uint32 | my_pitch, | ||
Uint32 | w, | ||
Uint32 | h, | ||
DWORD | flags, | ||
void * | pixel_format, | ||
CB_DRAW_PIXEL | cb_draw, | ||
MYBITMAP_CONTXT * | mybmp, | ||
BYTE * | alpha_mask | ||
) |
Compile a MYBITMAP pixel data to a BITMAP pixel data.
This function compile a MYBITMAP pixel data to a BITMAP pixel data.
void GUIAPI DeleteBitmapAlphaPixel | ( | PBITMAP | bmp | ) |
Deletes the bitmap alpha pixel format information of a BITMAP object.
This function deletes the bitmap alpha pixel format information of the BITMAP object bmp.
|
inlinestatic |
Convert a 16 color MYBITMAP pixel data to a BITMAP pixel data.
This function compile a 16 color MYBITMAP pixel data to a BITMAP pixel data.
hdc | The device context. |
bits | The BITMAP pixel data(RGBA etc.). |
pitch | The pitch of the BITMAP object. |
my_bits | The MYBITMAP pixel data to be compile. |
my_pitch | The pitch of the MYBITMAP object. |
w | The width of the MYBITMAP object. |
h | The height of the MYBITMAP object. |
flags | The flags of the MYBITMAP object. |
pal | The Palette of the MYBITMAP object. |
|
inlinestatic |
Convert a 256 color MYBITMAP pixel data to a BITMAP pixel data.
This function compile a 256 color MYBITMAP pixel data to a BITMAP pixel data.
hdc | The device context. |
bits | The BITMAP pixel data(RGBA etc.). |
pitch | The pitch of the BITMAP object. |
my_bits | The MYBITMAP pixel data to be compile. |
my_pitch | The pitch of the MYBITMAP object. |
w | The width of the MYBITMAP object. |
h | The height of the MYBITMAP object. |
flags | The flags of the MYBITMAP object. |
pal | The Palette of the MYBITMAP object. |
cb_draw | The draw callback function. |
mybmp | The context of cb_draw. |
void GUIAPI ExpandMonoBitmap | ( | HDC | hdc, |
BYTE * | bits, | ||
Uint32 | pitch, | ||
const BYTE * | my_bits, | ||
Uint32 | my_pitch, | ||
Uint32 | w, | ||
Uint32 | h, | ||
DWORD | flags, | ||
Uint32 | bg, | ||
Uint32 | fg | ||
) |
Convert a mono color MYBITMAP pixel data to a BITMAP pixel data.
This function compile a MYBITMAP pixel data to a BITMAP pixel data.
hdc | The device context. |
bits | The BITMAP pixel data(RGBA etc.). |
pitch | The pitch of the BITMAP object. |
my_bits | The MYBITMAP pixel data to be compile. |
my_pitch | The pitch of the MYBITMAP object. |
w | The width of the MYBITMAP object. |
h | The height of the MYBITMAP object. |
flags | The flags of the MYBITMAP object. |
bg | The foreground color of the BITMAP object. |
fg | The foreground color of the BITMAP object. |
int GUIAPI ExpandMyBitmap | ( | HDC | hdc, |
PBITMAP | bmp, | ||
const MYBITMAP * | my_bmp, | ||
const RGB * | pal, | ||
int | frame | ||
) |
Expands a MYBITMAP object to a BITMAP object.
This function expands the MYBITMAP object pointed to by my_bmp to a BITMAP object (bmp).
hdc | The device context. |
bmp | The expanded BITMAP object. |
my_bmp | The MYBITMAP object to be expanded. |
pal | The palette of the MYBITMAP object. |
frame | The frame of the MYBITMAP object. |
void void GUIAPI HFlipBitmap | ( | BITMAP * | bmp, |
unsigned char * | inter_buff | ||
) |
Horizontal Flip the special Bitmap object.
bmp | The BITMAP object. |
inter_buff | The one scan line pre-alloc buffer of bitmap. |
Initializes a BITMAP object as a normal bitmap.
This function initializes the bitmap pointed to by bmp as a normal bitmap. It sets the bitmap structure fields, and allocates the bits if bits is NULL.
hdc | The device context. |
w | The width of the bitmap. |
h | The height of the bitmap. |
pitch | The pitch of the bitmap. |
bits | The bits of the bitmap. |
bmp | The BITMAP object to be initialized. |
Initializes the bitmap pixel format information of a BITMAP object.
This function initializes the bitmap pixel format information of the BITMAP object pointed to by bmp. This includes bmBitsPerPixel and bmBytesPerPixel fields, and the private pixel format if the bitmap is a bitmap with alpha.
hdc | The device context. |
bmp | The BITMAP object to be initialized. |
Initializes scanline loader of the MYBITMAP object from a data source.
This function initializes scanline loader of the MYBITMAP object from a data source.
area | The data source. |
ext | The extension of the type of this bitmap. |
my_bmp | The pointer to the MYBITMAP object. |
pal | The palette will be returned. |
|
inlinestatic |
Initializes slave screen.
name | The gal engine name. |
mode | The display mode. For example : 640x480-16bpp. |
Definition at line 11703 of file gdi.h.
References InitSlaveScreenEx().
HDC GUIAPI InitSlaveScreenEx | ( | const char * | name, |
const char * | mode, | ||
int | dpi | ||
) |
Initializes slave screen.
name | The gal engine name. |
mode | The display mode. For example : 640x480-16bpp. |
dpi | The resolution of screen, should be a value larger than GDCAP_DPI_MINIMAL (36). |
Referenced by InitSlaveScreen().
|
inlinestatic |
Load a device-dependent bitmap from a general data source.
This function loads a device-dependent bitmap from the data source area.
hdc | The device context. |
pBitmap | The pointer to the BITMAP object. |
area | The data source. |
ext | The extension of the type of this bitmap. |
ERR_BMP_OK | Loading successfully |
ERR_BMP_IMAGE_TYPE | Not a valid bitmap. |
ERR_BMP_UNKNOWN_TYPE | Not recongnized bitmap type. |
ERR_BMP_CANT_READ | Read error. |
ERR_BMP_CANT_SAVE | Save error. |
ERR_BMP_NOT_SUPPORTED | Not supported bitmap type. |
ERR_BMP_MEM | Memory allocation error. |
ERR_BMP_LOAD | Loading error. |
ERR_BMP_FILEIO | I/O failed. |
ERR_BMP_OTHER | Other error. |
ERR_BMP_ERROR_SOURCE | A error data source. |
Definition at line 11386 of file gdi.h.
References LoadBitmapEx2(), and NULL.
int GUIAPI LoadBitmapEx2 | ( | HDC | hdc, |
PBITMAP | pBitmap, | ||
MG_RWops * | area, | ||
const char * | ext, | ||
CB_ALLOC_BITMAP_BUFF | cb_alloc_buff, | ||
void * | context | ||
) |
Load a device-dependent bitmap from a general data source.
This function loads a device-dependent bitmap from the data source area. This function gives a chance to the caller to allocate the pixel buffer of the BITMAP object in a different way.
hdc | The device context. |
pBitmap | The pointer to the BITMAP object. |
area | The data source. |
ext | The extension of the type of this bitmap. |
cb_alloc_buff | The callback to allocate the buffer for the pixels. If it is NULL, the function will allocate the buffer by calling malloc. |
context | The context will be passed to the cb_alloc_buff. |
ERR_BMP_OK | Loading successfully |
ERR_BMP_IMAGE_TYPE | Not a valid bitmap. |
ERR_BMP_UNKNOWN_TYPE | Not recongnized bitmap type. |
ERR_BMP_CANT_READ | Read error. |
ERR_BMP_CANT_SAVE | Save error. |
ERR_BMP_NOT_SUPPORTED | Not supported bitmap type. |
ERR_BMP_MEM | Memory allocation error. |
ERR_BMP_LOAD | Loading error. |
ERR_BMP_FILEIO | I/O failed. |
ERR_BMP_OTHER | Other error. |
ERR_BMP_ERROR_SOURCE | A error data source. |
Referenced by LoadBitmapEx().
Load a device-dependent bitmap from a file.
int GUIAPI LoadBitmapFromMem | ( | HDC | hdc, |
PBITMAP | pBitmap, | ||
const void * | mem, | ||
size_t | size, | ||
const char * | ext | ||
) |
Load a device-dependent bitmap from memory.
Load a MYBITMAP object from a data source.
This function loads a MYBITMAP object from the data source area.
my_bmp | The pointer to the MYBITMAP object. |
area | The data source. |
pal | The palette will be returned. |
ext | The extension of the type of this bitmap. |
Load a MYBITMAP object from a file.
int GUIAPI LoadMyBitmapFromMem | ( | PMYBITMAP | my_bmp, |
RGB * | pal, | ||
const void * | mem, | ||
size_t | size, | ||
const char * | ext | ||
) |
Load a MYBITMAP object from memory.
This function loads a MYBITMAP object from memory.
my_bmp | The pointer to the MYBITMAP object. |
pal | The palette will be retruned through this pointer. |
mem | The pointer to the memory area. |
size | The size of the memory area. |
ext | The extension name used to determine the type of the bitmap. |
int GUIAPI LoadMyBitmapSL | ( | MG_RWops * | area, |
void * | load_info, | ||
MYBITMAP * | my_bmp, | ||
CB_ONE_SCANLINE | cb, | ||
void * | context | ||
) |
Load MYBITMAP scanlines from a data source one by one.
This function loads MYBITMAP scanlines from the data source area one by one.
area | The data source. |
load_info | The initialized information retured by InitMyBitmapSL function. |
my_bmp | The pointer to the MYBITMAP object. |
cb | The callback to inform one scanline loaded. It can be NULL. |
context | The context information passed to the callback. |
Enable or Disable a MLShadow slave screen.
This function is used to enable or diable a MLShadow slave screen. After creating a slave screen by InitSlaveScreen successfully, its default status is disabled.
dc_mls | The handle of MLShadow slave screen. |
enable | Whether to enable the MLShadow slave screen. |
Paints an image from data source on device directly.
This function paints an image from data source onto device directly.
hdc | The device context. |
x | (x,y), the paint position on device. |
y | (x,y), the paint position on device. |
area | The data source. |
ext | The extension of the type of this bitmap. |
ERR_BMP_OK | Painted successfully |
ERR_BMP_IMAGE_TYPE | Not a valid image type. |
ERR_BMP_UNKNOWN_TYPE | Not recongnized bitmap type. |
ERR_BMP_CANT_READ | Read error. |
ERR_BMP_NOT_SUPPORTED | Not supported bitmap type. |
ERR_BMP_MEM | Memory allocation error. |
ERR_BMP_LOAD | Loading error. |
ERR_BMP_FILEIO | I/O failed. |
ERR_BMP_OTHER | Other error. |
ERR_BMP_ERROR_SOURCE | A error data source. |
int GUIAPI PaintImageFromFile | ( | HDC | hdc, |
int | x, | ||
int | y, | ||
const char * | spFileName | ||
) |
Paints an image from file on device directly.
hdc | The device context. |
x | (x,y), the paint position on device. |
y | (x,y), the paint position on device. |
spFileName | The file name of the image file. |
int GUIAPI PaintImageFromMem | ( | HDC | hdc, |
int | x, | ||
int | y, | ||
const void * | mem, | ||
size_t | size, | ||
const char * | ext | ||
) |
Paints an image from memory on device directly.
hdc | The device context. |
x | (x,y), the paint position on device. |
y | (x,y), the paint position on device. |
mem | The pointer to memory containing image data. |
size | The size of the image data. |
ext | The name of the image which indicates the type of the image. |
Pivot a bitmap object.
This function aligns the point in the bitmap given by (cx, cy) to (x, y) in device context, then rotates around this point.
void GUIAPI PivotScaledBitmapFlip | ( | HDC | hdc, |
const BITMAP * | bmp, | ||
fixed | x, | ||
fixed | y, | ||
fixed | cx, | ||
fixed | cy, | ||
int | angle, | ||
fixed | scale_x, | ||
fixed | scale_y, | ||
BOOL | h_flip, | ||
BOOL | v_flip | ||
) |
Rotates, stretches or shrinks, flips a bitmap object.
This function flips the bitmap vertically if v_flip is TRUE, flips the bitmap horizontally if h_flip is TRUE first. Then stretches or shrinks the bitmap according to scale and aligns the point in the bitmap given by (cx, cy) to (x, y) in device context, Finally rotates specified angle pointed to angle in 1/64ths of a degree around this point (cx, cy).
hdc | The device context. |
bmp | The pointer of BITMAP object. |
x | (x,y) The x coordinate of a point in fixed point on dc. |
y | (x,y) The y coordinate of a point in fixed point on dc. |
cx | (cx,cy) The x coordinate of a point in fixed point on the bitmap. |
cy | (cx,cy) The y coordinate of a point in fixed point on the bitmap. |
angle | The specified rotated angle around its center. |
scale_x | The ratio of width of stretching or shrinking the bitmap in fixed point. |
scale_y | The ratio of height of stretching or shrinking the bitmap in fixed point. |
h_flip | The flags of fliping horizontally. |
v_flip | The flags of fliping vertically. |
Replaces a specific pixels in a bitmap with another pixel.
This function replaces the specific pixels with value iOColor with the other pixel value iNcolor in the bitmap pBitmap.
hdc | The device context. |
pBitmap | The BITMAP object. |
iOColor | The pixel value of the color will be replaced. |
iNColor | The pixel value of the new color. |
Rotate a bitmap object.
hdc | The device context. |
bmp | The pointer of Bitmap object. |
lx | (lx,ty), the x coordinate of top left corner. |
ty | (lx,ty), the y coordinate of top left corner. |
angle | The specified rotated angle around its center. It must be in 1/64ths of a degree. |
Flips horizontally and rotates a bitmap object.
Flips vertically and rotates a bitmap object.
This function flips vertically before rotating the bitmap pointed to bmp.
void GUIAPI RotateScaledBitmap | ( | HDC | hdc, |
const BITMAP * | bmp, | ||
int | lx, | ||
int | ty, | ||
int | angle, | ||
int | w, | ||
int | h | ||
) |
Stretches or shrinks a bitmap object at the same as rotating it.
void GUIAPI RotateScaledBitmapHFlip | ( | HDC | hdc, |
const BITMAP * | bmp, | ||
int | lx, | ||
int | ty, | ||
int | angle, | ||
int | w, | ||
int | h | ||
) |
Flip horizontaly, rotates, stretch or shrinks a bitmap object.
This function is similar to RotateScaledBitmap() expect that it flips the bitmap horizontally first.
void GUIAPI RotateScaledBitmapVFlip | ( | HDC | hdc, |
const BITMAP * | bmp, | ||
int | lx, | ||
int | ty, | ||
int | angle, | ||
int | w, | ||
int | h | ||
) |
Flip vertically, rotates, stretch or shrinks a bitmap object.
This function is similar to RotateScaledBitmap() expect that it flips the bitmap vertically first.
Saves a BITMAP object to a bitmap file.
This function saves the BITMAP object pBitmap to the bitmap file named spFileName.
hdc | The device context. |
pBitmap | The BITMAP object. |
spFileName | The file name. |
Saves a MYBITMAP object to a bitmap file.
This function saves the MYBITMAP object my_bmp to the bitmap file named spFileName.
my_bmp | The MYBITMAP object. |
pal | The palette. |
spFileName | The file name. |
Set the bitmap color key.
This function set the bitmap member bmColorKey with the param r,g,b and set the BMP_TYPE_COLORKEY flag.
hdc | The device context. |
bmp | Point of the bitmap which to set color key. |
r | The red componets of RGB color. |
g | The green componets of RGB color. |
b | The blue componets of RGB color. |
/sa SetMemDCColorKey
int GUIAPI StretchPaintImageEx | ( | HDC | hdc, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
MG_RWops * | area, | ||
const char * | ext | ||
) |
Paints an image from data source on device directly.
This function paints an image from data source onto device directly with stretch.
hdc | The device context. |
x | (x,y), the paint position on device. |
y | (x,y), the paint position on device. |
w | the width of the stretched bitmap. |
h | the height of the stretched bitmap. |
area | The data source. |
ext | The extension of the type of this bitmap. |
ERR_BMP_OK | Painted successfully |
ERR_BMP_IMAGE_TYPE | Not a valid image type. |
ERR_BMP_UNKNOWN_TYPE | Not recongnized bitmap type. |
ERR_BMP_CANT_READ | Read error. |
ERR_BMP_NOT_SUPPORTED | Not supported bitmap type. |
ERR_BMP_MEM | Memory allocation error. |
ERR_BMP_LOAD | Loading error. |
ERR_BMP_FILEIO | I/O failed. |
ERR_BMP_OTHER | Other error. |
ERR_BMP_ERROR_SOURCE | A error data source. |
int GUIAPI StretchPaintImageFromFile | ( | HDC | hdc, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
const char * | spFileName | ||
) |
Paints an image from file on device directly.
hdc | The device context. |
x | (x,y), the paint position on device. |
y | (x,y), the paint position on device. |
w | The width of the stretched bitmap. |
h | The height of the stretched bitmap. |
spFileName | the file name of the image file. |
int GUIAPI StretchPaintImageFromMem | ( | HDC | hdc, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
const void * | mem, | ||
size_t | size, | ||
const char * | ext | ||
) |
Paints an image from memory on device directly.
hdc | The device context. |
x | (x,y) the paint position on device. |
y | (x,y) the paint position on device. |
w | The width of the stretched bitmap. |
h | The height of the stretched bitmap. |
mem | The pointer to memory containing image data. |
size | The size of the image data. |
ext | The name of the image which indicates the type of the image. |
void TerminateSlaveScreen | ( | HDC | hdc | ) |
Terminates slave screen.
hdc | The slave device context. |
void GUIAPI UnloadBitmap | ( | PBITMAP | pBitmap | ) |
Unloads a bitmap.
This function unloads the specified bitmap pBitmap. It will free the private pixel format and the bits of the bitmap.
pBitmap | The BITMAP object. |
void GUIAPI UnloadMyBitmap | ( | PMYBITMAP | my_bmp | ) |
Unloads a bitmap.
This function unloads the specified MYBITMAP object my_bmp. It will free the bits of the bitmap.
my_bmp | The pointer to the MYBITMAP object. |
void GUIAPI VFlipBitmap | ( | BITMAP * | bmp, |
unsigned char * | inter_buff | ||
) |
Vertical Flip the special Bitmap object.
bmp | The BITMAP object. |
inter_buff | The one scan line pre-alloc buffer of bitmap. |