請問有關影像處理的問題 |
尚未結案
|
newken
一般會員 發表:26 回覆:52 積分:15 註冊:2003-03-26 發送簡訊給我 |
|
RaynorPao
版主 發表:139 回覆:3622 積分:7025 註冊:2002-08-12 發送簡訊給我 |
引言: 請問各位前輩: 如何把兩張影像:image1 ,image2 做AND的運算 謝謝newken 你好: 假設 image1, image2 兩張圖的長/寬/Pixelformat 都一樣,看看以下的寫法對 不對呢?? < class="code"> Graphics::TBitmap *bmp1=new Graphics::TBitmap; Graphics::TBitmap *bmp2=new Graphics::TBitmap; bmp1->LoadFromFile("C:\\1.bmp"); Image1->Width=bmp1->Width; Image1->Height=bmp1->Height; Image1->Stretch=true; Image1->Picture->Assign(bmp1); bmp2->LoadFromFile("C:\\2.bmp"); Image2->Width=bmp2->Width; Image2->Height=bmp2->Height; Image2->Stretch=true; Image2->Picture->Assign(bmp2); Image3->Width=Image1->Width; Image3->Height=Image1->Height; Image3->Canvas->CopyMode=cmSrcCopy; Image3->Canvas->CopyRect(Rect(0, 0, Image3->Width, Image3->Height), bmp1->Canvas, Rect(0, 0, bmp1->Width, bmp1->Height)); Image3->Canvas->CopyMode=cmSrcAnd; Image3->Canvas->CopyRect(Rect(0, 0, Image3->Width, Image3->Height), bmp2->Canvas, Rect(0, 0, bmp2->Width, bmp2->Height)); Image3->Picture->Bitmap->SaveToFile("C:\\3.bmp"); delete bmp2; delete bmp1; -- Enjoy Researching & Developing -- 發表人 - RaynorPao 於 2003/10/31 15:31:25
------
-- 若您已經得到滿意的答覆,請適時結案!! -- -- 欲知前世因,今生受者是;欲知來世果,今生做者是 -- -- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 -- |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |