-
Delphi 利用API绘制弧形
Delphi 利用API绘制弧形,
begin
ArcRect := ClientRect;
Canvas.Pen.Width:=2;
for i:=1 to 10 do
begin
Arc(Canvas.Handle,ArcRect.Left,ArcRect.Top,ArcRect.Right,
ArcRect.Bottom,ArcRect.Right,(ArcRect.Bottom-ArcRect.Top) div 2,
ArcRect.Left,(ArcRect.Bottom-ArcRect.Top) div 2);
InflateRect(ArcRect,-2,-2);
Canvas.Pen.Color := PaletteIndex(i+10);
end;
- 2022-03-21 03:44:09下载
- 积分:1
-
Delphi 模拟制作Windows XP风格界面的下拉页
Delphi 模拟制作Windows XP风格界面的下拉页,实际上就是XP资源管理器界面的右侧窗口,鼠标单击会向下展开,再次单击会重新合拢,像一个折叠展开的面板那样,这种形式的窗口在Windows中已经早有应用,这只是一个用Delphi代码仿写的效果,希望对大家的Delphi界面设计有所帮助。
- 2022-07-24 03:34:24下载
- 积分:1
-
Delphi 渐变的RGB空心色环绘制源码演示
Delphi渐变圆形的实现方法,RGB色环空心绘制演示源码:
oBmp := TBitmap.Create; //为了代码整齐就不写try了
oBmp.PixelFormat := ABitmap.PixelFormat;
oBmp.Width := ABitmap.Width;
oBmp.Height := ABitmap.Height;
BitBlt(oBmp.Canvas.Handle, 0, 0, oBmp.Width, oBmp.Height, ABitmap.Canvas.Handle, 80, 80, SRCCOPY); //要拷贝的位图
oRgn := CreateEllipticRgn(0, 0, 100, 100); //创建圆形区域
SelectClipRgn(ABitmap.Canvas.Handle, oRgn); //选择剪切区域
ABitmap.Canvas.Draw(0, 0, oBmp); //位图位于区域内的部分加载
- 2022-03-21 13:09:53下载
- 积分:1
-
Delphi 制作的文字屏保
Delphi 制作的文字屏保,文字交替变化,晃动鼠标结束屏保。本程序的亮点是对文字动画效果的生成和控制。具有文字渐变和水平平移动画。
- 2022-03-28 23:49:31下载
- 积分:1
-
Delphi添加图层蒙版
Delphi添加图层蒙版,运行本程序后,在屏幕上添加一层阴影,透明度大概在70%左右,可看作是在屏幕上方蒙了一层薄膜的感觉,代码简单:procedure TForm1.FormCreate(Sender: TObject);
var
bTrans: Byte;
OldStyle: Integer;
begin
form1.Color := clGradientActiveCaption;
WindowState := wsMaximized;
BorderStyle := bsNone;
FormStyle := fsStayOnTop;
OldStyle := GetWindowLong(Handle, GWL_EXSTYLE);
SetWindowLong(Handle, GWL_EXSTYLE, OldStyle or WS_EX_LAYERED Or WS_EX_TRANSPARENT);
bTrans := 128;
SetLayeredWindowAttributes(Handle, 0, bTrans, LWA_ALPHA);
end;
- 2022-02-06 10:25:25下载
- 积分:1
-
Delphi 获取两个子字符串之间的字符个数
Delphi 获取两个子字符串之间的字符个数,也就是这个字符串由A/B/C三个字符组成,本例子是求A/C中间的所有字符串的个数,空格同样也包括在内。定义两个函数即可实现本功能:
Function TForm1.Strcount( s, s1, s2 : string ): integer;
var
i,j,slen : integer;
begin
i := pos( s1, s );
j := pos( s2, s );
slen := Length(s1);
if j >= i then
Result := j - i - slen
else
Result := 0;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
n : integer;
begin
n := Strcount(Edit1.Text,Edit2.Text,Edit3.Text);
showmessage(IntToStr(n));
end;
- 2022-01-26 07:45:23下载
- 积分:1
-
Delphi获取从开机到现在CPU运行的周期数
Delphi获取从开机到现在CPU运行的周期数,不是获取开机时间多长,是CPU的周期数,显示的值为数字字符串,运行效果如示例截图所示。代码段:
begin
Edit1.Text := inttostr(periodicity);
end;
- 2022-07-05 04:51:29下载
- 积分:1
-
Delphi 简单获取Windows时间的例子
简单获取Windows时间-Delphi源代码,改时间的小程序,在Windows自带的时间管理中也可完成系统时间的修改,这个只是一个帮助了解Windows与Delphi编程的例子,如何通过Delphi的程序来修改Windows时间,大致就是这样实现的。可参见以下源码:
procedure TForm1.Button1Click(Sender: TObject);
var
Dtimer : TSystemTime;
hh,Ghh : Integer;
begin
hh := StrToInt(Trim(Edit4.Text));
if hh < 8 then
Ghh := 16 + hh
else
Ghh := hh - 8;
with Dtimer do
begin
wYear:=StrToInt(Edit1.Text);
wMonth:=StrToInt(Edit2.Text);
wDay:=StrToInt(Edit3.Text);
wHour:=Ghh;
wMinute:=StrToInt(Edit5.Text);
wSecond:=StrToInt(Edit6.Text);
end;
SetSystemTime(Dtimer);
end;
- 2022-07-09 18:55:23下载
- 积分:1
-
Delphi 文件目录操作
一个基础的Delphi 文件目录操作示例,这里是拷贝指定的文件夹目录,一是了解复制文件的原理,二是熟悉Delphi中的目录操作技巧。
- 2022-03-15 15:35:17下载
- 积分:1
-
Visual C# 调用声音控制对话框
Visual C# 调用声音控制对话框,在windows Xp下表现挺好,在Windows7有些问题,调用的面板并不会显示出来,这是为何呢?windows调用 声音对话框的实例 ,基于Delphi7源码实现。
- 2022-03-10 20:40:03下载
- 积分:1