1.delphiä¸canvaså¨åª
2.delphiç»å¾
delphiä¸canvaså¨åª
æ¯ä¸ä¸ªçªä½ä¸èåä¹ä¸çæ´ä¸ªçªä½é½æ¯canvasï¼ç»å¸ï¼ãunit Unit1;interface
uses
Windows,画布画图君凤煌源码 Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{ $R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
canvas.LineTo(0,);
canvas.LineTo(,);
canvas.LineTo(,0);
end;
end.
delphiç»å¾
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Canvas.MoveTo(,);
Form1.Canvas.LineTo(,);//ä»(,)ç»çº¿å°(,)
Form1.Canvas.Ellipse(, , , );//ç»å
Form1.Canvas.Pixels[,] := clRed;//æ(,)ç¹æ¾ç¤ºçº¢è²
Form1.Canvas.TextOut(,,'åæå');
end;
å¦å¤çDelphiä¸å ³äºCanvas.TextOutçä¸ç¹èµæ
Canvas.Font.Color:=clblue;//åä½é¢è²
//Canvas.Brush.Color:=clred;//åºè²
Canvas.Brush.Style := bsClear;//éæ
canvas.textout(0,0,'avalokita');
æ两个 TImage
procedure TfrmMain.FormCreate(Sender: TObject);
begin
Image1.Canvas.Brush.Color := clBlack;
Image1.Canvas.FillRect(Image1.ClientRect);
Image1.Canvas.Font.Color := clRed;
Image1.Canvas.Font.Name := 'Times New Roman';
Image1.Canvas.Font.Size := ;
Image1.Canvas.TextOut(9, , 'Delphi');
end;
// 水平转
procedure TfrmMain.Button1Click(Sender: TObject);
var
i: integer;
begin
for i := 1 to Image1.Width do
BitBlt(Image2.Canvas.Handle, i, 0, 1, Image2.Height,
Image1.Canvas.Handle, Image1.Width - i, 0, SRCCOPY);
Image2.Refresh;
end;
// åç´è½¬
procedure TfrmMain.Button2Click(Sender: TObject);
var
i: integer;
begin
for i := 1 to Image1.Height do
BitBlt(Image2.Canvas.Handle, 0, i, Image2.Width, 1,
Image1.Canvas.Handle, 0, Image1.Height - i, SRCCOPY);
Image2.Refresh;
end;
ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼
1.å ·æCANVASå±æ§çæ§ä»¶:
TBitmap,TComboBox,TDBComboBox,TDBGrid,TDBListBox,TDirectoryListBox,
TDrawGrid,TFileListBox,TForm,THeaderControl,TImage,TListBox,TOutline,
TPaintBox,TPrinter,TStatusBar,TStringGridç,
2.CANVASå±æ§åå½ä»¤:ç¯å¹ æé,çç¥åæ°åæ ¼å¼è¯´æ,å ·ä½è¯·åèæåç¨åºåDELPHI帮å©æ件:
canvas.rectangle():ç»ç©å½¢pen.color:å®ä¹ç»ç¬é¢è²
roundrect():ç»åè§ç©å½¢pen.width:å®ä¹ç»ç¬å®½åº¦
arc():ç»å¼§çº¿(ä¸å¡«å ) brush.color:å®ä¹å¡«å é¢è²
chord():ç»å¼§çº¿(å¡«å ) textout():å¨åºå®ä½ç½®è¾åºå符串
pie:ç»æå½¢ textwidth:åå符串é«åº¦
polygon():ç»å¤è¾¹å½¢å¡«å textheight:åå符串宽度
polyline():å¤ç¹èæº(ä¸å¡«å )font.color:æå®åä½é¢è²
Pixels():æå®åºå®è±¡ç´ ç¹é¢è²å¼font.size:æå®åä½å¤§å°
moveto():ææç»çº¿èµ·ç¹ Ellipse():ç»åææ¤å
lineto():ææç»çº¿ç»ç¹
3.使ç¨CANVAS注æäºé¡¹:å½çªå£è¿è¡éç»æ¶,ç»å¸ä¸çå¾åå°æ¶å¤±,æ¯å¦å½çªå£è¿è¡æå°ååéæ°æ¢å¤æ¶ï¼å°±ä¼å¼èµ·ç»å¸ä¸å¾åçæ¶å¤±ï¼å¦å¤å½ååè¿è¡ç¨åºæ¶ï¼çªå£ä¹æ¯å±äºéæ°ç»å¶ï¼æ以å¦æå¨ç»å¶çªå£ä¹åå¨ç»å¸ä¸ç»å¾ï¼å¼¹åºçªå£åå°ä¸è½æ¾ç¤ºåºå¾åï¼æ¯å¦å¨TForm1.FormCreate()äºä»¶ä¸è¿è¡ç»å¸ç»å¾æä½å°æ¯å¾å³çï¼ä½å¯ä»¥å¨æ¤äºä»¶ä¸è¿è¡ç»å¸æä½çåå¤å·¥ä½ï¼æ¯å¦è®¾ç½®ç»ç¬çé¢è²å宽度çã
procedure TForm1.SpeedButton5MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
if Sender is Tspeedbutton then
begin
statusbar1.canvas.Brush.Color:=clwhite;
statusbar1.canvas.fillRect(statusbar1.Canvas.ClipRect);//æ¸ ç©ºç»å¸
statusbar1.Panels[0].Style:=psOwnerDraw;
statusbar1.Canvas.font.Color:=clred;//åä½é¢è²
statusbar1.Canvas.Brush.Color:=clblue;//åºè²
statusbar1.Canvas.brush.style:=bsclear; //éæ
statusbar1.Canvas.TextOut(0,5,'This is sample'); //å®ä½x,yåæ è½´åè¾å ¥æå
end;
end;
Canvas.Brush.Style:=bsclear å¯ä»¥å»æåä½çèæ¯
2024-11-29 18:24996人浏览
2024-11-29 18:08551人浏览
2024-11-29 17:52438人浏览
2024-11-29 17:451790人浏览
2024-11-29 17:361789人浏览
2024-11-29 17:011907人浏览
1.探索成品网源码1688站w:打造个性化网店的新选择!2.国精w灬源码1688怎么样?3.成品网站源码1688免费推荐:免费推荐与实用建议4.电子商务网站建设源码及数据库文件5.商业源码源码分类6.
1.【Mirror Networking】网络框架源码学习2.@Compose 注解到底做了什么?了解一下~3.Linux网络编程中网络传输KCP协议原理解析【Mirror Networking】网络