-
Delphi 播放指定avi-mid-wav文件
Delphi 播放指定avi-mid-wav文件,这几种都是音频格式,因此这个可以说是播放音频文件的例子,控制面板中包括了常用的播放控制按钮,在此基础上,可写出一个Delphi音乐播放器,当然本源码比较早了,适合学习一些简单的Delphi音频编程技巧。
procedure TForm1.N2Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
with MediaPlayer1 do
begin
Filename := OpenDialog1.FileName ;
Open;
DisPlayrect := Rect(1,1,Panel2.Width ,Panel2.Height );
Notify := true;
end;
end;
end;
- 2023-05-08 02:15:02下载
- 积分:1
-
delphi 获取网页源码
delphi 获取网页源码
- 2023-01-22 10:05:04下载
- 积分:1
-
Delphi 制作红绿眼镜三维立体画
这是一个Delphi色彩控制方面的示例,我看上去更像是Delphi分离出红绿颜色通道,从页形成的一种立体效果,复制和修改颜色模式来实现,相关代码可参考如下:
//设置添充颜色的大小
DBitmap.Width := LBitmap.Width;
DBitmap.Height := LBitmap.Height;
vRect := Rect(0, 0, DBitmap.Width, DBitmap.Height); //获取添充区域
DBitmap.Canvas.Brush.Color := vGreen; //设置画笔颜色
DBitmap.Canvas.FillRect(vRect); //添充颜色
LBitmap.Canvas.CopyMode := cmSrcPaint; //将复制模式改为OR
LBitmap.Canvas.CopyRect(vRect, DBitmap.Canvas, vRect); //对图片进行复制
DBitmap.Canvas.Brush.Color := vRed;
DBitmap.Canvas.FillRect(vRect);
RBitmap.Canvas.CopyMode := cmSrcPaint; //将复制模式改为OR
RBitmap.Canvas.CopyRect(vRect, DBitmap.Canvas, vRect); //对图片进行复制
DBitmap.Canvas.CopyRect(vRect, LBitmap.Canvas, vRect);
DBitmap.Canvas.CopyMode := cmSrcAnd; //将复制模式改为AND
DBitmap.Canvas.CopyRect(vRect, RBitmap.Canvas, vRect);
except
Exit;
end;
Result := True;
end;
- 2023-02-01 08:05:04下载
- 积分:1
-
Delphi实现TdxDBTreeView节点全部展开或收拢
本源码演示如何实现Delphi TdxDBTreeView节点全部展开或收拢功能,也就是大家熟悉的树形菜单节点的折叠或展开功能,在平时的使用中,树形节点是很常用的一个菜单功能,本例子的树形菜单节点功能读取自数据库,因此在测试前请连接好数据库。
//单击全部展开按钮
procedure TForm1.Button1Click(Sender: TObject);
begin
dxDBTreeView1.FullExpand;
end;
//单击全部收拢按钮
procedure TForm1.Button2Click(Sender: TObject);
begin
dxDBTreeView1.FullCollapse;
end;
- 2022-01-26 05:17:01下载
- 积分:1
-
Delphi 实现图像热点功能
Delphi 实现图像热点功能,实现一张图片上不同形状区域的热点,定义椭圆形、四边形、三角形的区域变量的热点,相关代码如下:
var
thepoint:array [1..8] of tpoint;//存储多边形顶点坐标
count:integer;
pointnum:array [1..2] of integer;
begin
//四边形顶点坐标,首末点封闭
thepoint[1]:=point(135,99);
thepoint[2]:=point(105,183);
thepoint[3]:=point(129,201);
thepoint[4]:=point(188,92);
thepoint[5]:=point(135,99);
count:=5;//四边形顶点数目,首末点为一点
fourE_rgn:=CreatePolygonRgn(thepoint,count,WINDING);//生成四边形区域
elli_rgn:=CreateEllipticRgn(64,221,231,263);// 生成椭圆形区域
//第一个三角形顶点坐标
thepoint[1]:=point(118,67);
thepoint[2]:=point(32,28);
thepoint[3]:=point(17,90);
thepoint[4]:=point(118,67);
//第二个三角形顶点坐标
thepoint[5]:=point(155,44);
thepoint[6]:=point(202,91);
thepoint[7]:=point(277,44);
thepoint[8]:=point(155,44);
pointnum[1]:=4;//第一个三角形顶点数目
pointnum[2]:=4;//第二个三角形顶点数目
count:=2;//三角形数目
//生成由两个三角形构成的三角形区域
tri_rgn:=CreatePolyPolygonRgn(thepoint,pointnum,count,WINDING);
end;
- 2022-01-26 08:02:50下载
- 积分:1
-
Delphi 格式化DataGrid表格中的数据
Delphi 格式化DataGrid表格中的数据,DataGrid网格列表在各种编程的数据库显示方面都使用广泛,因此对于Delphi的数据库编程,DataGrid的使用技巧是一定要撑握的,本源码所要演示的就是一个使用DataGrid的简单例子,将DataGrid表格中的数据格式式成你想要的格式,测试前请确保Delphi与数据库正常连接且有数据。
- 2022-01-25 15:23:01下载
- 积分:1
-
Delphi 隐藏或显示鼠标指针
Delphi 隐藏或显示鼠标指针,在编译后运行本程序生成的Exe程序,在窗口中单击鼠标左键,鼠标会消失,被隐藏了,再次单击后鼠标重现,很好的演示了在Delphi中如何显示或隐藏鼠标的操作。
- 2022-01-26 04:41:31下载
- 积分:1
-
Delphi 获取MonthCalendar中选择的日期
Delphi 获取MonthCalendar中选择的日期,其实就是完成一个时间、日期的选择功能,年份、月份、日期、时间都可自定义调整并选择,这个简单的例子,可演示Delphi中MonthCalendar的用法,生成一个日期时间选择器功能。下面是相关代码:
procedure TForm1.Button1Click(Sender: TObject);
var
Year,Month,Days: Word;
begin
DecodeDate(MonthCalendar1.Date,Year,Month,Days);
Edit1.Text:=IntToStr(Year);
Edit2.Text:=IntToStr(Month);
Edit3.Text:=IntToStr(Days);
end;
全部源码请下载本实例包。
- 2022-02-02 06:32:18下载
- 积分:1
-
Delphi7 向XML中添加RTTI信息
Delphi7.0 向XML中添加RTTI信息,这个例子挺简单,希望大家喜欢,面向Delphi新手的,高手请绕道哦,下面是本例Delphi向XML中添加RTTI信息的关键性代码:
procedure TForm1.ComponentToDOM(iNode: IXmlNode; Comp: TPersistent);
var
nProps, i: Integer;
PropList: PPropList;
Value: Variant;
newNode: IXmlNode;
begin
nProps := GetTypeData (Comp.ClassInfo)^.PropCount;
GetMem (PropList, nProps * SizeOf(Pointer));
try
GetPropInfos (Comp.ClassInfo, PropList);
for i := 0 to nProps - 1 do
begin
Value := GetPropValue (Comp, PropList [i].Name);
NewNode := iNode.AddChild(PropList [i].Name);
NewNode.Text := Value;
if (PropList [i].PropType^.Kind = tkClass) and (Value 0) then
if TObject (Integer(Value)) is TComponent then
NewNode.Text := TComponent (Integer(Value)).Name
else
ComponentToDOM (newNode, TObject (Integer(Value)) as TPersistent);
end;
finally
FreeMem (PropList);
end;
end;
- 2022-01-26 03:00:57下载
- 积分:1
-
Delphi 模拟制作Windows XP风格界面的下拉页
Delphi 模拟制作Windows XP风格界面的下拉页,实际上就是XP资源管理器界面的右侧窗口,鼠标单击会向下展开,再次单击会重新合拢,像一个折叠展开的面板那样,这种形式的窗口在Windows中已经早有应用,这只是一个用Delphi代码仿写的效果,希望对大家的Delphi界面设计有所帮助。
- 2022-07-24 03:34:24下载
- 积分:1