線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1296
推到 Plurk!
推到 Facebook!

如何把一個以上的Image全部顯示在Series1之中

尚未結案
imjoshua
一般會員


發表:36
回覆:21
積分:11
註冊:2005-03-16

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-04-24 03:16:37 IP:61.228.xxx.xxx 未訂閱
您好!我想請問的是如何在TChart中將Image1、2、3...以上的全部顯示在Series1中 以下是參考arisaka_matsuri大大後的程式碼 // 統計水平與垂直方向的投影量 long ProjectV[256] = {0}; long ProjectH[256] = {0}; long Vmax = 0, Hmax = 0; Byte *ptr; for(int row = 0; row < 256; row ) { ptr = (Byte *)Image1->Picture->Bitmap->ScanLine[row]; for(int col = 0; col < 256; col ) { if(ptr[col*3] == 0) { ProjectV[col] ; // 垂直方向投影的數量 1 ProjectH[row] ; // 水平方向投影的數量 1 if(ProjectV[col] > Vmax) Vmax = ProjectV[col]; // 統計垂直投影最大值 if(ProjectH[row] > Hmax) Hmax = ProjectH[row]; // 統計水平投影最大值 } } } //畫出曲線投影 TLineSeries* Series1 = new TLineSeries(this); Series1->ParentChart = Chart1; for(int col = 0; col < 256; col ) Series1->AddXY(col, ProjectV[col], "", clRed); TLineSeries* Series2 = new TLineSeries(this); Series2->ParentChart = Chart2; for(int row = 0; row < 256; row ) Series2->AddXY(row, ProjectH[row], "", clBlack); joshua
------
joshua
sew
一般會員


發表:2
回覆:54
積分:21
註冊:2003-08-25

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-04-24 13:04:24 IP:61.228.xxx.xxx 未訂閱
您的意思是不是要秀在同一個Tchar上? 那只要將程式碼Series2->ParentChart = Chart2;改成 Series2->ParentChart = Chart1; 應該就可以了 加油!
------
加油!
imjoshua
一般會員


發表:36
回覆:21
積分:11
註冊:2005-03-16

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-04-24 13:38:58 IP:220.139.xxx.xxx 未訂閱
您好!!我是想把水平跟垂直分成二個chart然後再把複數的垂直或水平曲線分別 放入1個chart1和chart2(如chart1放的全是垂直的投影量)     轉成這樣 打擾您寶貴閱讀時間在此跟您說聲抱歉!! 發表人 -
------
joshua
sew
一般會員


發表:2
回覆:54
積分:21
註冊:2003-08-25

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-04-24 20:24:58 IP:220.136.xxx.xxx 未訂閱
您可以用滑鼠左鍵點二下TChart元件,可開啟其設定對話窗 在chart標籤中的series下,可以新增series等資訊 您可先設定好之後再用程式碼去指令畫到哪一個tchart    或是例如
 
TLineSeries* Series1_v = new TLineSeries(this);
Series1_v->ParentChart = Chart1;
 for(int col = 0; col < 256; col  )
  Series1_v->AddXY(col, ProjectV[col], "", clRed);
TLineSeries* Series2_v = new TLineSeries(this);
Series2_v->ParentChart = Chart1;
 for(int row = 0; row < 256; row  )
  Series2_v->AddXY(row, ProjectH[row], "", clBlack);    TLineSeries* Series1_h = new TLineSeries(this);
Series1_h->ParentChart = Chart2;
 for(int col = 0; col < 256; col  )
  Series1_h->AddXY(col, ProjectV[col], "", clRed);
TLineSeries* Series2_h = new TLineSeries(this);
Series2_h->ParentChart = Chart2;
 for(int row = 0; row < 256; row  )
  Series2_h->AddXY(row, ProjectH[row], "", clBlack); 
其中Series1_v是代表image1的垂直投影量 Series2_v是代表image1的垂直投影量 Series1_h是代表image1的水平投影量 Series2_h是代表image1的水平投影量 加油!
------
加油!
imjoshua
一般會員


發表:36
回覆:21
積分:11
註冊:2005-03-16

發送簡訊給我
#5 引用回覆 回覆 發表時間:2005-04-25 13:37:12 IP:61.228.xxx.xxx 未訂閱
您好!實在是太抱歉了!! 可能是我說的太模糊了~><" 我的意思是我現在>>>>>>>>
------
joshua
sew
一般會員


發表:2
回覆:54
積分:21
註冊:2003-08-25

發送簡訊給我
#6 引用回覆 回覆 發表時間:2005-04-25 20:40:42 IP:218.166.xxx.xxx 未訂閱
引言: 您可以用滑鼠左鍵點二下TChart元件,可開啟其設定對話窗 在chart標籤中的series下,可以新增series等資訊 您可先設定好之後再用程式碼去指令畫到哪一個tchart 或是例如 TLineSeries* Series1_v = new TLineSeries(this); Series1_v->ParentChart = Chart1; for(int col = 0; col < 256; col ) Series1_v->AddXY(col, ProjectV[col], "", clRed); TLineSeries* Series2_v = new TLineSeries(this); Series2_v->ParentChart = Chart1; for(int row = 0; row < 256; row ) Series2_v->AddXY(row, ProjectH[row], "", clBlack); TLineSeries* Series1_h = new TLineSeries(this); Series1_h->ParentChart = Chart2; for(int col = 0; col < 256; col ) Series1_h->AddXY(col, ProjectV[col], "", clRed); TLineSeries* Series2_h = new TLineSeries(this); Series2_h->ParentChart = Chart2; for(int row = 0; row < 256; row ) Series2_h->AddXY(row, ProjectH[row], "", clBlack); 其中Series1_v是代表image1的垂直投影量 Series2_v是代表image1的垂直投影量 Series1_h是代表image1的水平投影量 Series2_h是代表image1的水平投影量
其中有地方我寫錯了,不好意思 以下是修正的部份 Series1_v是代表image1的垂直投影量 Series2_v是代表image2的垂直投影量 Series1_h是代表image1的水平投影量 Series2_h是代表image2的水平投影量 而Series1_v及Series2_v同繪在chart1 而Series1_h及Series2_h同繪在chart2 這樣應該有達到您的需求 加油!
------
加油!
imjoshua
一般會員


發表:36
回覆:21
積分:11
註冊:2005-03-16

發送簡訊給我
#7 引用回覆 回覆 發表時間:2005-04-26 01:35:49 IP:61.228.xxx.xxx 未訂閱
謝謝您!!您的意思一定是這樣吧!!     //垂直1 TLineSeries* Series1 = new TLineSeries(this); Series1->ParentChart = Chart1; for(int col = 0; col < 256; col++)   Series1->AddXY(col, ProjectV[col], "", clRed); //垂直2 TLineSeries* Series2 = new TLineSeries(this); Series2->ParentChart = Chart1; for(int col = 0; col < 256; col++) Series2->AddXY(col, ProjectV[col], "", clBlack);    但呆呆的我卻只能把如二個Image的水平1、2垂直1、2放在不同的button 如 可以把垂1、2 水1、2都放在一個Button1上面嗎? 打擾您保貴的閱讀時間在此跟您說聲抱歉!!
------
joshua
sew
一般會員


發表:2
回覆:54
積分:21
註冊:2003-08-25

發送簡訊給我
#8 引用回覆 回覆 發表時間:2005-04-26 08:51:40 IP:220.130.xxx.xxx 未訂閱
把您的code post上來看看吧 方便大家來解 加油!
------
加油!
imjoshua
一般會員


發表:36
回覆:21
積分:11
註冊:2005-03-16

發送簡訊給我
#9 引用回覆 回覆 發表時間:2005-04-30 16:10:53 IP:61.228.xxx.xxx 未訂閱
實在抱歉!前二天學校在考VB6所以遲遲未回 其實就是這樣 >>> > > >>>>> > > >> > 打擾您保貴的閱讀時間在此跟您說聲抱歉!!
------
joshua
imjoshua
一般會員


發表:36
回覆:21
積分:11
註冊:2005-03-16

發送簡訊給我
#10 引用回覆 回覆 發表時間:2005-05-01 02:12:50 IP:61.228.xxx.xxx 未訂閱
我太呆嚕~原來腦筋一轉就可以了~ 抱歉!打擾各位大大了! 問題已排除!謝謝各位的幫助! 打擾您保貴的閱讀時間在此跟您說聲抱歉!!
------
joshua
系統時間:2024-05-13 20:07:46
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!