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

PaintBox1控件遇到的问题

尚未結案
chenliyan163
一般會員


發表:30
回覆:30
積分:12
註冊:2003-09-15

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-03-26 20:58:08 IP:61.175.xxx.xxx 未訂閱
我在PaintBox1MouseUp时记录在PaintBox1上所画的内容,当选择到哪个TabControl1.TabIndex时就将PaintBox1重画,但用PaintBox1.Canvas.Draw(0,0,bmp0);却使终显示不出来。 procedure Tmainform.TabControl1Change(Sender: TObject); begin                           case mainform.TabControl1.TabIndex  of                             0:begin                                    mainform.Image1.Show;                                    mainform.Image2.Hide;                                    mainform.Image3.Hide;                                    mainform.Image4.Hide;                                    mainform.Image5.Hide;                                    PaintBox1.Canvas.Draw(0,0,bmp0);                               end;                             1:begin                                    mainform.Image1.Hide;                                    mainform.Image2.Show;                                    mainform.Image3.Hide;                                    mainform.Image4.Hide;                                    mainform.Image5.Hide;                                    mainform.Image2.Picture.Bitmap:=bmp1;                               end;                             2:begin                                    mainform.Image1.Hide;                                    mainform.Image2.Hide;                                    mainform.Image3.Show;                                    mainform.Image4.Hide;                                    mainform.Image5.Hide;                                    mainform.Image3.Picture.Bitmap:=bmp2;                               end;                             3:begin                                    mainform.Image1.Hide;                                    mainform.Image2.Hide;                                    mainform.Image3.Hide;                                    mainform.Image4.Show;                                    mainform.Image5.Hide;                                    mainform.Image4.Picture.Bitmap:=bmp3;                               end;                             4:begin                                    mainform.Image1.Hide;                                    mainform.Image2.Hide;                                    mainform.Image3.Hide;                                    mainform.Image4.Hide;                                    mainform.Image5.Show;                                    mainform.Image5.Picture.Bitmap:=bmp4;                               end;                        end; end;    procedure Tmainform.PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;   Shift: TShiftState; X, Y: Integer); begin                        case mainform.TabControl1.TabIndex  of                             0:begin   bmp0:=TBitmap.Create ;   bmp0.Width:=PaintBox1.Width ;   bmp0.Height:=PaintBox1.Height ;   BitBlt(bmp0.canvas.handle,0,0,bmp0.width,bmp0.height,          PaintBox1.Canvas.Handle,0,0,SRCCOPY) ;  // 将图像存内存                               end;                             1:begin   bmp1:=TBitmap.Create ;   bmp1.Width:=PaintBox1.Width ;   bmp1.Height:=PaintBox1.Height ;   BitBlt(bmp1.canvas.handle,0,0,bmp1.width,bmp1.height,          PaintBox1.Canvas.Handle,0,0,SRCCOPY) ;  // 将图像存内存                               end;                             2:begin   bmp2:=TBitmap.Create ;   bmp2.Width:=PaintBox1.Width ;   bmp2.Height:=PaintBox1.Height ;   BitBlt(bmp2.canvas.handle,0,0,bmp2.width,bmp2.height,          PaintBox1.Canvas.Handle,0,0,SRCCOPY) ;  // 将图像存内存                               end;                             3:begin   bmp3:=TBitmap.Create ;   bmp3.Width:=PaintBox1.Width ;   bmp3.Height:=PaintBox1.Height ;   BitBlt(bmp3.canvas.handle,0,0,bmp3.width,bmp3.height,          PaintBox1.Canvas.Handle,0,0,SRCCOPY) ;  // 将图像存内存                               end;                             4:begin   bmp4:=TBitmap.Create ;   bmp4.Width:=PaintBox1.Width ;   bmp4.Height:=PaintBox1.Height ;   BitBlt(bmp4.canvas.handle,0,0,bmp4.width,bmp4.height,          PaintBox1.Canvas.Handle,0,0,SRCCOPY) ;  // 将图像存内存                               end;                        end; end;
系統時間:2024-05-02 16:29:56
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!