Vampyre Imaging Library Forum

Imaging Category => Help & Questions => Topic started by: pka4916 on 19 March 2010, 20:44:57

Title: Copyrect doesn't work?
Post by: pka4916 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?

    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);
Title: Re: Copyrect doesn't work?
Post by: Galfar 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.