請問影像反白的問題 |
答題得分者是:taishyang
|
wen142
一般會員 發表:22 回覆:27 積分:14 註冊:2004-06-30 發送簡訊給我 |
各位大大您們好:
想請問一下我作影像反白的結果影像
理當整頁都反白
卻產生下面的現象
我的程式碼
Byte* ptr;
Graphics::TBitmap *TheBitmap; TheBitmap=Image1->Picture->Bitmap ;
Edit3->Text =TheBitmap->Height ;
Edit4->Text =TheBitmap->Width ; for(int y=0; y < TheBitmap->Height ;y++)
{
ptr = (Byte*)TheBitmap->ScanLine[y]; for(int x=0; x < TheBitmap->Width ; x++ )
{ ptr[x]=(Byte)(255-ptr[x]);}
} Repaint();
請各位大大幫我瞧一下哪裡出了問題 謝謝^^ 發表人 - taishyang 於 2004/09/06 12:02:25
|
taishyang
站務副站長 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
您好:
改成下面這樣
for(int x=0; x < TheBitmap->Width ; x ) { ptr[x*3 ] = (Byte)(255-ptr[x*3 ]); ptr[x*3 1] = (Byte)(255-ptr[x*3 1]); ptr[x*3 2] = (Byte)(255-ptr[x*3 2]); }P.S: PO程式碼的方式請參考版規說明 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=47262 順心 發表人 - |
wen142
一般會員 發表:22 回覆:27 積分:14 註冊:2004-06-30 發送簡訊給我 |
|
taishyang
站務副站長 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
|
wen142
一般會員 發表:22 回覆:27 積分:14 註冊:2004-06-30 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |