全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:841
推到 Plurk!
推到 Facebook!

動態TImage上之事件問題

尚未結案
braveheart
一般會員


發表:35
回覆:62
積分:24
註冊:2003-05-21

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-06-11 16:57:32 IP:61.222.xxx.xxx 未訂閱
請問各位先進..當在程式中動態產生影像物件.若當在動態產生IMAGE上建立OnDblClick..即將所產生的IMAGE上找適合的影像時..按兩下將所要的IMAGE ASSIGN到FORM1->Image1上...會只找最後顯示的IMAGE..請問各位先進...這可有法可以解決..謝謝先進
newForm[m] = new TForm(Form1);    //動態產生一個newform放image
  Image[m] = new TImage(newForm[m]); //動態產生一個image至於newform
  Image[m]->Parent         = newForm[m];
  Image[m]->ParentShowHint = True;
  newForm[m]->Width        = Image1->Width;
  newForm[m]->Height       = Image1->Height;
  newForm[m]->Caption = "FCM Form  = "   IntToStr(m 1);
  Image[m]->Width          = EndX-StartX 1;
  Image[m]->Height         = EndY-StartY 1;
  Image[m]->Picture->Bitmap->Assign(Bit);
  newForm[m]->FormStyle    = fsStayOnTop;
  newForm[m]->Position     = poScreenCenter;
  Image[m]->MyClick;
  newForm[m]->Show();    void __fastcall TForm1::MyClick(TObject *Sender)
{
  Graphics::TBitmap *bmp=new Graphics::TBitmap;
  int **ImageBuffer;
  SelectImage = m;
  int W = newForm[SelectImage]->Image[SelectImage]->Width;
  int H = newForm[SelectImage]->Image[SelectImage]->Height;
  bmp->Assign(Image1->Picture->Bitmap);
  bmp->Width = W;
  bmp->Height = H;
  bmp->PixelFormat = pf24bit;
  ImageBuffer=new int*[W];      for (int i=0;iImage[SelectImage]->Picture->Bitmap->ScanLine[j];
    for( int i=0; iScanLine[j];
    for( int i=0; iImage1->Picture->Bitmap->Assign(bmp);
  SelectForm->Show();
  delete bmp;
  for (int i=0;i        發表人 - taishyang 於 2004/06/11  18:29:06
        
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-06-21 10:30:23 IP:61.218.xxx.xxx 未訂閱
void __fastcall TForm1::MyClick(TObject *Sender) {   TImage* s=(TImage*) Sender; Graphics::TBitmap *bmp=new Graphics::TBitmap; int **ImageBuffer; int W = s->Width; int H = s->Height; bmp->Assign(Image1->Picture->Bitmap); bmp->Width = W; bmp->Height = H; bmp->PixelFormat = pf24bit; ImageBuffer=new int*[W]; for (int i=0;i ptr = (Byte *)s->Picture->Bitmap->ScanLine[j]; for( int i=0; i
------
︿︿
braveheart
一般會員


發表:35
回覆:62
積分:24
註冊:2003-05-21

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-06-23 00:13:35 IP:61.71.xxx.xxx 未訂閱
感謝先進...要開始好好研讀了....
系統時間:2024-05-14 17:57:25
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!