Prev Top Next
Name

KXL_CopyStretchImageRect

Synopsis
KXL_CopyStretchImageRect -- The arbitrary rectangles of an image are expanded or reduced and it copies to a new image.

Description
KXL_Image *KXL_CopyStretchImageRect(KXL_Image *img, KXL_Rect rect, Uint16 width, Uint16 height);

Arguments

imgPointer of KXL_Image structure.
rectKXL_Rect structure.
widthNew width
heightNew height


Return Value

Pointer of new KXL_Image structure.


Exsample
sample.bmp


#include <KXL.h>

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

  KXL_CreateWindow(100, 100, "sample", 0);
  img = KXL_LoadBitmap("sample.bmp", 0);
  rect.Left = 0;
  rect.Top = 0;
  rect.Width = img->Width;
  rect.Height = img->Height;
  copy_img = KXL_CopyStretchImageRect(img, rect, 78, 78);
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(img, 10, 10);
  KXL_PutImage(copy_img, 20, 20);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(img);
  KXL_DeleteImage(copy_img);
  KXL_DeleteWindow();
  return 0;
}