不好意思 我是新手..不知道第3張相減的圖 不能儲存 希望各位前輩指導
void __fastcall TForm1::BN_subtractClick(TObject *Sender)
{
for (int i=0;ibuffer2[i])
buffer3[i]=buffer1[i]-buffer2[i];
else
buffer3[i]=buffer2[i]-buffer1[i];
}
capGrabFrameNoStop(hCapWnd); //從CCD中抓取單格影像,但不會停止其他動作
capEditCopy(hCapWnd);
TMemoryStream *stream=new TMemoryStream;
HDC ScreenDC=GetDC(hCapWnd);
Graphics::TBitmap *bmp1=new Graphics::TBitmap();
bmp1->Width = CapWidth;
bmp1->Height = CapHeight;
bmp1->PixelFormat=pf24bit; StretchBlt(bmp1->Canvas->Handle,0,0,CapWidth,CapHeight,
ScreenDC,0,0,CapWidth,CapHeight,SRCCOPY); stream->Position=0;
stream->Clear();
stream->SetSize(bmpFileSize); bmp1->SaveToFile("image3.bmp");
stream->Position = 0; stream->Write(buffer3,bmpFileSize);
stream->Position = 0;
Image3->Picture->Bitmap->LoadFromStream(stream);
delete stream;
delete bmp1; }
//--------------------------------------------------------------------------- 發表人 - kilter 於 2005/06/26 00:49:15 發表人 - kilter 於 2005/06/26 00:59:27