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

如何將座標~show在image圖上

 
rabbit78585
一般會員


發表:11
回覆:22
積分:6
註冊:2006-08-22

發送簡訊給我
#1 引用回覆 回覆 發表時間:2007-03-23 16:29:36 IP:163.23.xxx.xxx 訂閱
如何將座標點以紅點方式~show在image圖上
請問各位大大
RaynorPao
版主


發表:139
回覆:3622
積分:7025
註冊:2002-08-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2007-03-26 11:38:41 IP:220.130.xxx.xxx 訂閱
請參考以下的程式碼自行修改!

__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
DoubleBuffered=true; // 若 Image1 放在 Form1 上面,請加入這一行
// Panel1->DoubleBuffered=true; // 若 Image1 放在 Panel1 上面,請加入這一行
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int X=100, Y=100;
Image1->Canvas->Brush->Color=clRed;
Image1->Canvas->Brush->Style=bsSolid;
Image1->Canvas->FillRect(Rect(X-1, Y-1, X 1, Y 1));
Image1->Canvas->Brush->Style=bsClear;
Image1->Canvas->TextOut(X 2, Y-2, "(" IntToStr(X) "," IntToStr(Y) ")");
}

------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
rabbit78585
一般會員


發表:11
回覆:22
積分:6
註冊:2006-08-22

發送簡訊給我
#3 引用回覆 回覆 發表時間:2007-03-26 20:29:04 IP:163.23.xxx.xxx 訂閱
謝謝
===================引 用 文 章===================
請參考以下的程式碼自行修改!

__fastcall TForm1::TForm1(TComponent* Owner)
?? : TForm(Owner)
{
?? DoubleBuffered=true; // 若 Image1 放在 Form1 上面,請加入這一行
?? // Panel1->DoubleBuffered=true; // 若 Image1 放在 Panel1 上面,請加入這一行
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
?? int X=100, Y=100;
?? Image1->Canvas->Brush->Color=clRed;
?? Image1->Canvas->Brush->Style=bsSolid;
?? Image1->Canvas->FillRect(Rect(X-1, Y-1, X 1, Y 1));
?? Image1->Canvas->Brush->Style=bsClear;
?? Image1->Canvas->TextOut(X 2, Y-2, "(" IntToStr(X) "," IntToStr(Y) ")");
}

系統時間:2024-05-06 1:05:35
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!