Author Topic: Copyrect doesn't work?  (Read 765 times)

Offline pka4916

  • Imaging User
  • *
  • Posts: 9
    • View Profile
Copyrect doesn't work?
« on: 19 March 2010, 20:44:57 »
I am trying to copy a part of img to img2
but it won't save anything to a file for  img2. 
the file doesn't get written at all.
what am i missing here?

Code: [Select]
    InitImage(Img);
    InitImage(Img2);
    loadimagefromfile('c:\icon1.png',img);
    imaging.CopyRect(img,0,0,214,200,img2,110,110);

    saveimagetofile('c:\11.png',img2);
    saveimagetofile('c:\12.png',img);

Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 312
    • View Profile
    • Galfar's Homepage
Re: Copyrect doesn't work?
« Reply #1 on: 22 March 2010, 18:00:08 »
Img2 is empty (size 0x0 pixels) so you can't copy anything into it. Use NewImage function before CopyRect.