コード例 #1
0
ファイル: GD.cs プロジェクト: ststeiger/GdCaptcha
        public void Resize(int destW, int destH)
        {
            CheckDisposed();

            //TODO: resize img and replace this.handle with new img
            IntPtr imageHandle;

            imageHandle = GDImport.gdImageCreateTrueColor(destW, destH);
            if (imageHandle == IntPtr.Zero)
            {
                throw new ApplicationException("ImageCreatefailed.");
            }

            GDImport.gdImageCopyResampled(
                imageHandle, this.Handle,
                0, 0, 0, 0,
                destW, destH, this.Width, this.Height);

            GDImport.gdImageDestroy(this.Handle);
            this.handle = new HandleRef(this, imageHandle);
        }
コード例 #2
0
ファイル: GD.cs プロジェクト: ststeiger/GdCaptcha
 public void CopyResampled(GD src, int dstX, int dstY, int srcX, int srcY, int destW, int destH, int srcW, int srcH)
 {
     GDImport.gdImageCopyResampled(this.Handle, src.GetHandle().Handle, dstX, dstY, srcX, srcY, destW, destH, srcW, srcH);
 }