動態TImage上之事件問題 |
尚未結案
|
braveheart
一般會員 發表:35 回覆:62 積分:24 註冊:2003-05-21 發送簡訊給我 |
請問各位先進..當在程式中動態產生影像物件.若當在動態產生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;i |
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
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
------
︿︿ |
braveheart
一般會員 發表:35 回覆:62 積分:24 註冊:2003-05-21 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |