Prev Top Next

Name
KXL_LoadBitmap
Synopsis

    KXL_LoadBitmap -- An image is created from a bitmap file.
    The bitmap file must be saved in 4bpp(16 colors) or 8bpp(256 colors) color.

Description

    KXL_Image *KXL_LoadBitmap(Uint8 *filename, Uint8 maskno);

Arguments

filename | Bitmap file name.
maskno | The color number of a transparent color.

Return Value
Pointer of KXL_Image structure.
Exsample

    sample.bmp - 131 colors.

    0 number is black.

    #include <KXL.h>
    int main(void)
    {
      KXL_Image *mask_img, *nomask_img;

      KXL_CreateWindow(100, 100, "sample", 0);
      mask_img = KXL_LoadBitmap("sample.bmp", 0);
      nomask_img = KXL_LoadBitmap("sample.bmp", 255);

      KXL_SetDrawColor(0x00, 0x00, 0xff);
      KXL_ClearFrameImm(0, 0, 100, 100);
      KXL_PutImage(nomask_img, 10, 10);
      KXL_PutImage(mask_img, 50, 50);
      KXL_UpDateImm(0, 0, 100, 100);
      getchar();
      KXL_DeleteImage(mask_img);
      KXL_DeleteImage(nomask_img);
      KXL_DeleteWindow();
      return 0;
    }