= & Assign( )的差別 |
答題得分者是:taishyang
|
Allanx
一般會員 ![]() ![]() 發表:13 回覆:20 積分:6 註冊:2003-10-06 發送簡訊給我 |
|
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
Allanx您好: 效果是一樣的,只要型態一致即可,下面是從Help節錄出來的
Copies a new bitmap image to the bitmap object. virtual void __fastcall Assign(Classes::TPersistent* Source);Description Assign copies the bitmap image contained in Source to the bitmap object. Assign then calls the parent class's Assign. If the bitmap needs to be changed, the actual bitmap image is copied before the changes are made (copy on write). Note An object of one type can always be assigned to another object of the same type. Also, the Source can be of type TPicture if the Graphic property of the picture is a bitmap. 順心 |
Allanx
一般會員 ![]() ![]() 發表:13 回覆:20 積分:6 註冊:2003-10-06 發送簡訊給我 |
何謂型態?
包含:Image的height..Width..還是...? 還有我現在做了一個Button是用來找邊界ㄉ功能..
是想先將圖形按二值化的Button後,再按這個找邊界的Button
可是一直有問題..... 以下是書裡寫的code
Byte *ptr,*tptr,*uptr,*dptr;
int up,down,left,right,sum;
Graphics::TBitmap *TheBitmap,*TempBitmap; TheBitmap=Image1->Picture->Bitmap;
// 產生一ㄍ臨時圖像以便作處理
TempBitmap=new Graphics::TBitmap();
TempBitmap->Assign(TheBitmap); //執行濾波器
for(int y=0;y
|
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
Allanx您好:
PO程式碼的方式請參考版規
http://delphi.ktop.com.tw/topic.php?TOPIC_ID=45789
謝謝您的配合
引言: 知道問題出在哪?然後我找到一個Code是跟這有關ㄉ(見下),希望可以解釋一下.. int __fastcall TForm1::ExpendFilter(int i,int j)這行的元件如何點選呢?ExpendFilter(int i,int j),這不是元件,是一個屬於Form1的Method 找邊緣您可以參考小弟的拙作 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=40159 當中的邊緣偵測 順心 |
Allanx
一般會員 ![]() ![]() 發表:13 回覆:20 積分:6 註冊:2003-10-06 發送簡訊給我 |
|
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
|
Allanx
一般會員 ![]() ![]() 發表:13 回覆:20 積分:6 註冊:2003-10-06 發送簡訊給我 |
|
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
Allanx您好:
引言: 這下糟糕ㄌ...我用ㄉ是5.0ㄉ... 難怪找不到...該怎辦ㄋㄟhttp://delphi.ktop.com.tw/topic.php?TOPIC_ID=28358 這裡有BCB5.0的版本(舊的) |
arisaka_matsuri
高階會員 ![]() ![]() ![]() ![]() 發表:25 回覆:205 積分:231 註冊:2003-10-19 發送簡訊給我 |
Allanx 你好:
"Image1->Picture->Bitmap" 是一個 Graphics::TBitmap 的指標,所以TheBitmap必定也是一個 Graphics::TBitmap 的指標。這個語法就像是以下程式的結果:
int a = 10, b = 20; int *ptr1, *ptr2, *ptr3; ptr1 = &a; ptr2 = &b; ptr3 = ptr1; // 跟這行的效果一樣所以當 *ptr3 = 30; 時,a的值也變成30。當改變TheBitmap,實際上就是改變Image1->Picture->Bitmap(因為是指標)。 若是 "TempBitmap->Assign(TheBitmap)",則相當於 *ptr2 = *ptr1; // 跟這行的效果一樣,把a的值拷貝到b所以TempBitmap是TheBitmap的複本,就算改變TempBitmap,TheBitmap還是不會變。 |
Allanx
一般會員 ![]() ![]() 發表:13 回覆:20 積分:6 註冊:2003-10-06 發送簡訊給我 |
|
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
|
Allanx
一般會員 ![]() ![]() 發表:13 回覆:20 積分:6 註冊:2003-10-06 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |