如何到資料夾進行圖片比對 |
尚未結案
|
frankh
一般會員 發表:25 回覆:36 積分:12 註冊:2005-05-04 發送簡訊給我 |
|
frankh
一般會員 發表:25 回覆:36 積分:12 註冊:2005-05-04 發送簡訊給我 |
|
justdo
高階會員 發表:2 回覆:359 積分:222 註冊:2004-08-17 發送簡訊給我 |
|
poaivy
中階會員 發表:40 回覆:78 積分:53 註冊:2004-08-09 發送簡訊給我 |
TSearchRec sr; String path = 資料夾路徑; String mask = "*.bmp"; int iAttributes = 0; iAttributes |= faArchive; if (FindFirst(path mask, iAttributes, sr) == 0) { do { if ((sr.Attr & iAttributes) == sr.Attr) { Image1->Picture->LoadFormFile(path sr.Name); 這裡可以做你想要的比對工作; 做完順便記錄其值,直到整個資料夾比對結束找出差異最小的。 } } while (FindNext(sr) == 0); FindClose(sr); }試看看吧 |
frankh
一般會員 發表:25 回覆:36 積分:12 註冊:2005-05-04 發送簡訊給我 |
poaivy您好:
我試過了..但有些不懂的地方..像我原本有按鈕建的原始碼是不是直接把它刪掉就可以了?還有一個地方是我不知道我的原始碼是否有錯..因為我一直run不出來...可以幫我看一下嗎?
void __fastcall TForm1::Button5Click(TObject *Sender) { //Graphics::TBitmap *Bmp[0] = new Graphics::TBitmap(); //Graphics::TBitmap *Bmp[1] = new Graphics::TBitmap(); //Graphics::TBitmap *Bmp[2] = new Graphics::TBitmap(); //Graphics::TBitmap *Bmp[3] = new Graphics::TBitmap(); TSearchRec sr; String path = c:/test; String mask = "*.bmp"; int iAttributes = 0; iAttributes |= faArchive; if (FindFirst(path mask, iAttributes, sr) == 0) { do { if ((sr.Attr & iAttributes) == sr.Attr) { Image1->Picture->LoadFormFile(path sr.Name); Graphics::TBitmap *Bmp[4]; for(int i = 0; i < 4; i ) Bmp[i] = new Graphics::TBitmap(); Bmp[0]->Assign(Image1->Picture->Bitmap); Bmp[1]->Assign(Image2->Picture->Bitmap); Bmp[2]->Assign(Image3->Picture->Bitmap); Bmp[3]->Assign(Image4->Picture->Bitmap); Byte *ptr1,*ptr2,*ptr3,*ptr4; int temp[4]; for (int i=0;i發表人 - frankh 於 2005/08/29 19:11:19 |
frankh
一般會員 發表:25 回覆:36 積分:12 註冊:2005-05-04 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |