關於存檔以及RGB |
答題得分者是:ikk
|
andyshooter
一般會員 發表:6 回覆:10 積分:3 註冊:2009-04-01 發送簡訊給我 |
|
ikk
尊榮會員 發表:4 回覆:413 積分:768 註冊:2003-06-30 發送簡訊給我 |
存檔的code?? 應該是你的code出問題..
有image就很容易取出RGB, [code cpp] r = GetRValue(Image1->Canvas->Pixels[x][y]); g = GetGValue(Image1->Canvas->Pixels[x][y]); b = GetBValue(Image1->Canvas->Pixels[x][y]); [/code]
------
FPGA驗證, FPGA開發平台, http://smims.com
編輯記錄
ikk 重新編輯於 2009-04-01 15:08:50, 註解 無‧
|
andyshooter
一般會員 發表:6 回覆:10 積分:3 註冊:2009-04-01 發送簡訊給我 |
|
ikk
尊榮會員 發表:4 回覆:413 積分:768 註冊:2003-06-30 發送簡訊給我 |
|
andyshooter
一般會員 發表:6 回覆:10 積分:3 註冊:2009-04-01 發送簡訊給我 |
Byte *ptr1,*aptr1;
TMDIChild *Child; TJPEGImage *TheJPEG ; Child = (TMDIChild *)ActiveMDIChild; if( SavePictureDialog1->Execute()) { if (SavePictureDialog1->FilterIndex == 1) Child->Image1->Picture->SaveToFile(SavePictureDialog1->FileName); else if(SavePictureDialog1->FilterIndex == 2) { TheJPEG=new TJPEGImage; TheJPEG->Assign(Child->Image1->Picture->Bitmap); TheJPEG->SaveToFile(SavePictureDialog1->FileName); } } 以上是我SAVE TO JPG 的程式碼 請問我是不是少打什麼 不然怎麼副檔名不會出來??? TMDIChild *Child; Graphics::TBitmap *TheBitmap, *tempBitmap; int Width, Height; int x,y; Byte r,g,b; Child=(TMDIChild*)ActiveMDIChild; tempBitmap =new Graphics::TBitmap(); TheBitmap=Child->Image1->Picture->Bitmap; tempBitmap->Assign(TheBitmap); Width= TheBitmap->Width; Height= TheBitmap->Height; for (int y=0; y< Height; y ) for (int x=0; x< Width; x ) r = GetRValue(Child->Image1->Canvas->Pixels[x][y]); g = GetGValue(Child->Image1->Canvas->Pixels[x][y]); b = GetBValue(Child->Image1->Canvas->Pixels[x][y]); TheBitmap->Assign(tempBitmap); delete tempBitmap; 以上這些是我把RGB公式帶進去 但是執行之後沒有反應耶 是不是我還缺少了什麼呢?
編輯記錄
andyshooter 重新編輯於 2009-04-01 19:12:59, 註解 無‧
andyshooter 重新編輯於 2009-04-01 19:15:40, 註解 無‧ andyshooter 重新編輯於 2009-04-01 19:20:43, 註解 無‧ |
ikk
尊榮會員 發表:4 回覆:413 積分:768 註冊:2003-06-30 發送簡訊給我 |
|
andyshooter
一般會員 發表:6 回覆:10 積分:3 註冊:2009-04-01 發送簡訊給我 |
|
andyshooter
一般會員 發表:6 回覆:10 積分:3 註冊:2009-04-01 發送簡訊給我 |
TMDIChild *Child;
Graphics::TBitmap *TheBitmap, *tempBitmap; int Width, Height; int x,y; Byte r,g,b; TImage *imgTarget; Child=(TMDIChild*)ActiveMDIChild; tempBitmap =new Graphics::TBitmap(); TheBitmap=Child->Image1->Picture->Bitmap; tempBitmap->Assign(TheBitmap); Width= TheBitmap->Width; Height= TheBitmap->Height; TCanvas *MyCanvas=imgTarget->Canvas; for (int y=0; y< Height; y ) { for (int x=0; x< Width; x ) { r = GetRValue(Child->Image1->Canvas->Pixels[x][y]); g = GetGValue(Child->Image1->Canvas->Pixels[x][y]); b = GetBValue(Child->Image1->Canvas->Pixels[x][y]); } } TheBitmap->Assign(tempBitmap); delete tempBitmap; 我有做一些更改了 包括括弧和canvas 但是我在執行的時候會出現錯誤 並且會卡在紅色的那行
編輯記錄
andyshooter 重新編輯於 2009-04-05 14:25:25, 註解 無‧
|
ikk
尊榮會員 發表:4 回覆:413 積分:768 註冊:2003-06-30 發送簡訊給我 |
|
andyshooter
一般會員 發表:6 回覆:10 積分:3 註冊:2009-04-01 發送簡訊給我 |
|
ikk
尊榮會員 發表:4 回覆:413 積分:768 註冊:2003-06-30 發送簡訊給我 |
你for 迴圈只有取出值, 沒有其他動作, 當然沒反應...
[code cpp] for (int y=0; y< Height; y ) { for (int x=0; x< Width; x ) { r = GetRValue(Child->Image1->Canvas->Pixels[x][y]); g = GetGValue(Child->Image1->Canvas->Pixels[x][y]); b = GetBValue(Child->Image1->Canvas->Pixels[x][y]); } } [/code]
------
FPGA驗證, FPGA開發平台, http://smims.com |
andyshooter
一般會員 發表:6 回覆:10 積分:3 註冊:2009-04-01 發送簡訊給我 |
|
taishyang
站務副站長 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
別澆熄ikk前輩的熱情了,麻煩自己先研究把自己寫的程式碼PO出來問
您的問題不是一兩個function就可以完成的,至少有個雛形讓前輩們幫你看看問題再哪 而不是直接來要code好嗎? ===================引 用 andyshooter 文 章=================== 所以接下來該寫什麼呢??? 可以寫給我嗎?
編輯記錄
taishyang 重新編輯於 2009-04-06 15:00:21, 註解 無‧
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |