-
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在窗口中单击左键弹出菜单
Delphi在窗口中单击左键弹出菜单,在运行的窗体空白外,单击鼠标左键,弹出主菜单,其实和右键 菜单 是一样的原理,希望通过这个简单的例子,了解自定义窗口菜单的实现方法。
- 2023-09-08 18:20:03下载
- 积分: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生成图片水平交错的动态显示效果
用Delphi生成图片水平交错的动态显示效果,是一个简单的图片动态显示效果,显示图片的时候,以水平左右交错的方式显示,可用于电子相册中,用于多张图片切换时的过渡动画效果。
本程序有个缺点:只支持BMP的图片,对JPG支持不好,其它格式也不行哦。
- 2022-03-23 01:50:52下载
- 积分:1
-
Delphi 当鼠标和键盘在一定时间没有动作时关闭程序
Delphi 当鼠标和键盘在一定时间没有动作时关闭程序,这是一个智能化程序,类似于屏保,当一定时间没有操作时,会关闭软件,运行的技术也不很高深,有兴趣的可下载源代码研究学习。
- 2022-10-11 13:05:03下载
- 积分:1
-
Delphi 键盘钩子 封锁 windows 热键
Delphi 键盘钩子 封锁 windows 热键,封锁范围,可参见以下代码:
keycost := LPKBDLLHOOKSTRUCT(lParam);
if (keycost.vkCode=91) then//封锁win键
exit;
if (keycost.vkCode=VK_ESCAPE) and (GetAsyncKeyState(VK_CONTROL)0) then
exit; //封锁 ALT+TAB
if (keycost.vkCode=115) and ((keycost.flags and LLKHF_ALTDOWN)>0) then
exit; //封锁 ALT+F4
if (keycost.vkCode=VK_ESCAPE) and ((keycost.flags and LLKHF_ALTDOWN)>0) then
exit; //封锁 ALT+ESC
if (keycost.vkCode=VK_SPACE) and (GetAsyncKeyState(VK_CONTROL)
- 2023-03-30 06:05:03下载
- 积分:1
-
delphi windows远程桌面链接源码,带代理功能,支持win2012
delphi windows远程桌面链接源码,带代理功能,支持win2012 原创代码
- 2023-02-10 08:55:03下载
- 积分:1
-
Delphi 使DBGrid支持鼠标滚轮
Delphi 使DBGrid支持鼠标滚轮,测试前请确保程序已连接好数据库,否则会有很长一段时间反应,读取的数据会显示在DBGrid控件中,请在DBGrid组件中滚动鼠标滚轮,可将整个列表上下滚动,便于浏览数据,这个功能在一些软件中经常会遇到,具体编写思路请下载源码研究。
- 2022-04-12 01:26:52下载
- 积分:1
-
一个包括了下拉菜单的Delphi窗口设计范例程序
一个包括了菜单的Delphi窗口设计范例程序,以一个销售管理系统的主窗口界面设计为例,演示在窗体中添加下拉菜单、主窗口显示区、状态栏、标题栏等窗口元素,比较适合Delphi初学者学习。窗口中的下拉菜单我认为需要掌握,在很多的Delphi应用程序中,都会有此需求,欢迎下载源码。
- 2022-12-24 17:00:02下载
- 积分:1
-
Delphi 获取磁盘序号
Delphi 获取磁盘序号,获取序号非磁盘编号,也不是序列号。运行后的效果如图所示,应该是所选择的磁盘在我的电脑中的排列序号。
操作时,只需选择对应的盘符,然后单击按钮即可,请参见测试截图所示。
- 2022-07-24 20:22:04下载
- 积分:1