/* * The following code loads a BITMAP object from a file and then * fills a box in a DC. * * You should note that the code assigns 'bmType' field of the BITMAP object directly. */ { int tox = 800, toy = 800; int count; BITMAP bitmap; unsigned int start_tick, end_tick; /* Load the bitmap from the file. */ if (LoadBitmap (hdc, &bitmap, "res/icon.bmp")) return; bitmap.bmType = BMP_TYPE_ALPHACHANNEL; /* Fill a box with the bitmap with alpha channel. */ start_tick = GetTickCount (); count = 1000; while (count--) { tox = rand() % 800; toy = rand() % 800; /* Set a random alpha channel. */ bitmap.bmAlpha = rand() % 256; /* Fill the box. */ FillBoxWithBitmap (hdc, tox, toy, 0, 0, &bitmap); } end_tick = GetTickCount (); TellSpeed (hwnd, start_tick, end_tick, "Alpha Blended Bitmap", 1000); bitmap.bmType = BMP_TYPE_ALPHACHANNEL | BMP_TYPE_COLORKEY; /* Set the color key (the transparent pixel) of the bitmap. */ bitmap.bmColorKey = GetPixelInBitmap (&bitmap, 0, 0); /* Fill a box with the bitmap with alpha channel and color key. */ start_tick = GetTickCount (); count = 1000; while (count--) { tox = rand() % 800; toy = rand() % 800; /* Set a random alpha channel. */ bitmap.bmAlpha = rand() % 256; /* Fill the box. */ FillBoxWithBitmap (hdc, tox, toy, 0, 0, &bitmap); } end_tick = GetTickCount (); TellSpeed (hwnd, start_tick, end_tick, "Alpha Blended Transparent Bitmap", 1000); UnloadBitmap (&bitmap); }
|
|
An alias of LoadBitmapFromFile.
|
|
|
Alias of LoadMyBitmapFromFile.
|
|
|
The type of scanline loaded callback.
|
|
|
Checks 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.
|
|
||||||||||||
|
Cleanups the scanline loader. This function cleanups the scanline loader.
|
|
|
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.
|
|
||||||||||||||||||||||||
|
Expands a MYBITMAP object to a BITMAP object. This function expands the MYBITMAP object pointed to by my_bmp to a BITMAP object (bmp).
|
|
||||||||||||||||||||||||||||
|
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.
|
|
||||||||||||
|
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.
|
|
||||||||||||||||||||
|
Initializes scanline loader of the MYBITMAP object from a data source. This function initializes scanline loader of the MYBITMAP object from a data source.
|
|
||||||||||||||||||||
|
Loads a device-dependent bitmap from a general data source. This function loads a device-dependent bitmap from the data source area.
|
|
||||||||||||||||
|
Loads a device-dependent bitmap from a file.
|
|
||||||||||||||||||||||||
|
Loads a device-dependent bitmap from memory.
|
|
||||||||||||||||||||
|
Loads a MYBITMAP object from a data source. This function loads a MYBITMAP object from the data source area.
|
|
||||||||||||||||
|
Loads a MYBITMAP object from a file.
|
|
||||||||||||||||||||||||
|
Loads a MYBITMAP object from memory. This function loads a MYBITMAP object from memory.
|
|
||||||||||||||||||||||||
|
Loads MYBITMAP scanlines from a data source one by one. This function loads MYBITMAP scanlines from the data source area one by one.
|
|
||||||||||||||||||||||||
|
Paints an image from data source on device directly. This function paints an image from data source onto device directly.
|
|
||||||||||||||||||||
|
Paints an image from file on device directly.
|
|
||||||||||||||||||||||||||||
|
Paints an image from memory on device directly.
|
|
||||||||||||||||||||||||||||||||
|
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.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
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).
|
|
||||||||||||||||||||||||||||
|
Registers a bitmap file loader, saver, and checker. This function registers a new bitmap file loader, saver, and checker. You should pass the extension of the bitmap files, the functions to init, load, and cleanup this type of bitmap file, the function to save, and the function to check the type.
|
|
||||||||||||||||||||
|
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.
|
|
||||||||||||||||||||||||
|
Rotate a bitmap object.
|
|
||||||||||||||||||||||||
|
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.
|
|
||||||||||||||||||||||||||||||||
|
Stretches or shrinks a bitmap object at the same as rotating it.
|
|
||||||||||||||||||||||||||||||||
|
Flip horizontaly, rotates, stretch or shrinks a bitmap object. This function is similar to RotateScaledBitmap() expect that it flips the bitmap horizontally first.
|
|
||||||||||||||||||||||||||||||||
|
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.
|
|
||||||||||||||||
|
Saves a MYBITMAP object to a bitmap file. This function saves the MYBITMAP object my_bmp to the bitmap file named spFileName.
|
|
||||||||||||||||||||||||||||||||
|
Paints an image from data source on device directly. This function paints an image from data source onto device directly with stretch.
|
|
||||||||||||||||||||||||||||
|
Paints an image from file on device directly.
|
|
||||||||||||||||||||||||||||||||||||
|
Paints an image from memory on device directly.
|
|
|
Unloads a bitmap. This function unloads the specified bitmap pBitmap. It will free the private pixel format and the bits of the bitmap.
|
|
|
Unloads a bitmap. This function unloads the specified MYBITMAP object my_bmp. It will free the bits of the bitmap.
|
1.4.2