конвертация в png
| Код | procedure pngcre; var bmp: TBitmap; DC: HDC; png: TPngImage; Begin Try bmp:= TBitmap.Create; png:= Tpngimage.create; bmp.Height:=Screen.Height; bmp.Width:=Screen.Width; DC:=GetDC(0); bitblt(bmp.Canvas.Handle, 0, 0, Screen.Width, Screen.Height, DC, 0, 0, SRCCOPY); png.Assign(Bmp);
png.SaveToFile('c:\test.png'); ReleaseDC(0, DC); finally Bmp.Free; png.Free; End; End;
|
в gif
| Код | procedure gifcre; var bmp: TBitmap; DC: HDC; gif: TGIFImage; Begin Try bmp:= TBitmap.Create; gif:= TGIFImage.create; bmp.Height:=Screen.Height; bmp.Width:=Screen.Width; DC:=GetDC(0); bitblt(bmp.Canvas.Handle, 0, 0, Screen.Width, Screen.Height, DC, 0, 0, SRCCOPY); gif.Assign(Bmp);
gif.SaveToFile('c:\test.gif'); ReleaseDC(0, DC); finally Bmp.Free; gif.Free; End; End;
|
|