如何從txt檔中將其值存成矩陣?? |
答題得分者是:BON362
|
parano
一般會員 發表:14 回覆:6 積分:4 註冊:2007-02-02 發送簡訊給我 |
<textarea class="cpp" rows="10" cols="60" name="code">
void __fastcall TForm1::Button8Click(TObject *Sender)
{
Graphics::TBitmap *TheBitmap, *TempBitmap;
unsigned short Width=0, Height=0;
unsigned short clRGB=0,c2RGB;
unsigned short ***pix,***pix1;
float ***Intp;
float ***ML;
float ***F;
float ***Gou;
unsigned short T=0;
unsigned short i=0;
unsigned short nn=0;
unsigned short max=0;
unsigned short ifx=0,ify=0,idx=0,idy=0;
float Por=0;
unsigned short T_sml=0;
unsigned short Depth_mag=0;
float maxvalue=0;
float dx=0,dy=0,fx=0,fy=0,nfx=0,nfy=0;
unsigned short N=0;
float Xw=0,Yw=0,Zw=0;
double start,end,tot_time; AnsiString Dir;
T=StrToInt(Edit4->Text); //欲處理之影像張數
T_sml=StrToInt(Edit2->Text); //低於閥值,視為背景
Depth_mag=StrToInt(Edit3->Text); //深度倍率
N=StrToInt(Edit5->Text); //聚焦度量測視窗尺寸N*N
Por=StrToFloat(Edit7->Text); //換算比例
dx=StrToFloat(Edit8->Text); //第一張圖跟最後一張圖的x偏移量
dy=StrToFloat(Edit9->Text); //第一張圖跟最後一張圖的y偏移量 if (OpenDialog1->Execute())
Dir=ExtractFileDir(OpenDialog1->FileName); AnsiString Txtname;
if(OpenDialog2->Execute())
{
Txtname=OpenDialog2->FileName ".txt";
}
FILE *fp,*fp1;
fp=fopen(Txtname.c_str(),"w");
//fp1=fopen("constract.txt","w"); pix=new unsigned short**[T]; start=clock(); for (unsigned short i=0;i
編輯記錄
parano 重新編輯於 2007-06-08 18:49:08, 註解 無‧
|
parano
一般會員 發表:14 回覆:6 積分:4 註冊:2007-02-02 發送簡訊給我 |
|
BON362
一般會員 發表:3 回覆:16 積分:13 註冊:2007-05-28 發送簡訊給我 |
我是用c++寫的,讀的檔案是"123.txt"你把他轉放到bcb是可以用的,不知道這是你要個東西嗎??
<textarea cols="60" rows="10" class="cpp" name="code"> #include ===================引 用 parano 文 章=================== 我的txt檔格式如下所示: 0 0 0.2 0.3 0.5 0.6 0.25 0.347 0.23 0.6 0.25 0.36 . . . . . .
------
加油吧 C |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |