扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:尹小元 来源:csdn开发高手 2007年10月31日
关键字:
procedure draw_sroll(Sender:TForm;X0,Y0,W,H,R,G,B,lw:integer); var i,J,j1,J2,J3,m,X,Y,i1,i2:integer; begin J1:=R div lw-2; J2:=G div lw; J3:=B div lw+2; m:=lw div 3; with Sender do begin for i:=0 to lw do begin i1:=i; i2:=i; if h=0 then i1:=0; if w=0 then i2:=0; if i<m then j:=m-i else j:=i-m; Canvas.pen.color:=rgb(R-J1*J,G-J2*J,BJ3*J); canvas.moveTo(i1+X0,i2+Y0); canvas.lineTo(i1+W+X0,i2+H+Y0); end; end; end; |
procedure draw_rect(Sender:TForm;X0,Y0,W,H,R,G,B,lw,ww,fg:integer); var ii,i,J,j1,J2,J3,m:integer; begin J1:=R div lw-2; J2:=G div lw; J3:=B div lw+2; m:=lw div 3; if fg=1 then{fg=0 ê.°.} begin j1:=j1 div 2+(j1+2) div 3; j2:=j2 div 2+(j2+2) div 3; j3:=j3 div 2+(j3+2) div 3; end; with Sender do begin Canvas.Brush.Style:=bsClear; for ii:=0 to lw do begin if fg=0 then begin i:=ii; if i<m then j:=m-i else j:=i-m; end else i:=lw-ii; j:=ii; Canvas.pen.color:=rgb(R-J1*J,G-J2*J,B-J3*J); canvas.RoundRect(i+X0-lw,i+Y0-lw,X0+W-i+lw, H+Y0-i+lw,ww,ww); end; end; end; |
procedure TForm2.FormPaint(Sender: TObject); begin draw_bk(Form2,60,60,255);//画蓝色渐变背景 draw_roll(Form2,0,0,640,480,250,200,100,10); //画边框周围铜柱 with Image1 do draw_rect(Form2,left,top,width,height, 250,200,100,10,1,1); //画图片框 with Panel1 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel2 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel3 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel4 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel5 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel6 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel7 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel8 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel9 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel10 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel11 do draw_rect(Form2,left,top,width, height*2+2,250,238,238,10,1,1); with Panel13 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel14 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel16 do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); //以上画键盘 with sele_fun do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with Panel15 do draw_rect(Form2,left,top,222,height, 250,238,238,10,1,1); with Panel15 do draw_rect(Form2,left-11,top-11,242, 350,250,258,238,10,1,1); draw_sroll(Form2,291,5,0,470,250,200,100,12); with gd do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); with gk do draw_rect(Form2,left,top,width,height, 250,238,238,10,1,1); end; |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者