void foto(int stx,int sty,int fnw, int fnh)
{
//int stx,sty,fnw,fnh;
//stx=100;
//sty=100;
//fnw=100;
//fnh=200; unsigned DataHandle;
HPALETTE APalette;
Word Format;
Graphics::TBitmap *Bitmap=new Graphics::TBitmap;
HDC DC=GetDC(0);
try{
Bitmap->Height=fnh;
Bitmap->Width=fnw;
BitBlt(Bitmap->Canvas->Handle , 0, 0, fnw, fnh,DC, stx, sty, SRCCOPY);
Bitmap->SaveToClipboardFormat(Format,DataHandle,APalette);
Form2->Image1->Picture->LoadFromClipboardFormat(Format,DataHandle,APalette);
Form2->Image1->Picture->SaveToFile("C:\\CARD\\"+Form1->MY->Text + "\\"+Form1->KARTA->Text+".bmp");
}
catch(...){}
}
//-----------------------------------------------------------
foto(100,100,100,100);