Prev Top Next

Name
KXL_CopyImageImm
Synopsis

    KXL_CopyImageImm -- The arbitrary rectangles of an image are copied to a new image.

Description

    KXL_Image *KXL_CopyImageImm(KXL_Image *img, Sint16 left, Sint16
    top, Uint16 width, Uint16 height);

Arguments

img | Pointer of KXL_Image structure.
left | Left position of a source image.
top | Top position of a source image.
width | Width of a source image.
height | Height of a source image.

Return Value
Pointer of new KXL_Image structure.
Exsample

    sample.bmp

    #include <KXL.h>

    int main(void)
    {
      KXL_Image *img, *copy_img;

      KXL_CreateWindow(100, 100, "sample", 0);
      img = KXL_LoadBitmap("sample.bmp", 0);
      copy_img = KXL_CopyImageImm(img, 8, 8, 16, 16);

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