DeWeb : 制作图片轮换效果

演示:http://www.web0000.com/slide.dw
源代码:http://www.web0000.com/media/source/slide.zip
一、新建一个DLL
二、除第一行外,更改源码为
uses
ShareMem, SysUtils, Forms, Messages, StdCtrls,
Variants, Windows, Classes,
unit1 in 'unit1.pas' {Form1}; {$R *.res}
type
PdwGetEvent=function (ACtrl:TComponent;AData:String):string; StdCall;
var
DLLApp : TApplication;
DLLScreen : TScreen;
function dwLoad(AParams:String;AApp:TApplication;AScreen:TScreen):TForm;stdcall;
var
AForm : TForm1;
begin
//
Application := AApp;
Screen := AScreen;
AForm := TForm1.Create(nil);
AForm.Hint := AParams;
Result := AForm;
end; procedure DLLUnloadProc(dwReason: DWORD);
begin
if dwReason = DLL_PROCESS_DETACH then begin
Application := DLLApp; //恢复
Screen := DLLScreen;
end;
end; exports
dwLoad; begin
DLLApp := Application; //保存 DLL 中初始的 Application
DLLScreen := Screen;
DLLProc := @DLLUnloadProc;//保证卸载时恢复原Application
DLLUnloadProc(DLL_PROCESS_DETACH);
end.
三、新建一个Form,保存为unit1.pas. 窗体名称为Form1
四、在合适位置旋转1个TImage、1个TTimer和3个TButton
五、在TTimer的OnTimer事件中写入
procedure TForm1.Timer_SlideTimer(Sender: TObject);
begin
//set tag
if Timer_Slide.Tag<3 then begin
Timer_Slide.Tag := Timer_Slide.Tag + 1;
end else begin
Timer_Slide.Tag := 1;
end;
//change the image src
Image_MN.Hint := '{"src":"/media/images/mn/'+IntToStr(Timer_Slide.Tag)+'.jpg"}';
end;
六、3个按钮的Caption分别为1,2,3,
设置OnEnter事件代码为
procedure TForm1.Button1Enter(Sender: TObject);
begin
//Stop the slide timer
Timer_Slide.DesignInfo := 0;
//set tag
Timer_Slide.Tag := StrToIntDef(TButton(Sender).Caption,1);
//change the image src
Image_MN.Hint := '{"src":"/media/images/mn/'+IntToStr(Timer_Slide.Tag)+'.jpg"}'; end;
设置OnExit事件代码为
procedure TForm1.Button1Exit(Sender: TObject);
begin
//start the slide timer
Timer_Slide.DesignInfo := 1; end;
这样基本上就可以了。
DeWeb : 制作图片轮换效果的更多相关文章
- Jquery实现图片轮换效果
最近在看jquery书时,看到一个比较有趣的东西:图片轮换.这里和大家分享下我看完后写的一个demo.实现图片轮换要完成三部分模块:html部分.css部分.jqury部分.下面分步详细说明.1.ht ...
- WPF设置VistualBrush的Visual属性制作图片放大镜效果
原文:WPF设置VistualBrush的Visual属性制作图片放大镜效果 效果图片:原理:设置VistualBrush的Visual属性,利用它的Viewbox属性进行缩放. XAML代码:// ...
- 仿FLASH的图片轮换效果
css布局代码(test.css): body { background: #ccc;} ul { padding: 0; margin: 0;} li { list-style: none;} im ...
- jQuery仿迅雷图片轮换效果
jQuery仿迅雷图片轮换效果 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ht ...
- 如何通过PS制作图片文字效果
如图这是最终效果,下面我为大家介绍如何制作这种图片文字效果 准备一张图: 方法,步骤: 首先我们打开PHOTOSHOP,插入一张图片. 之后按键盘上面的"T"键快捷键启用文字工具, ...
- Canvas + JavaScript 制作图片粒子效果
首先看一下源图和转换成粒子效果的对比图: 左侧图片为源图,右侧图片为粒子效果图.该效果是在Canvas画布上制作的.将图片制作成粒子效果相对而言是比较简单的.重点了解两个知识点即可 1:图 ...
- JS 阶段练习~ 仿flash的图片轮换效果
结合了所学的简单运动框架~ 做这样一个综合小实例~~ -------------------------主要问题: 1.getByClassName IE低版的兼容性 2.DOM不够严谨 … 各种 ...
- jquery带小图的图片轮换效果
右边显示大图,左边显示小图 <style> ul{ list-style:none; padding:0px; margin:0px;} li{ list-style:none; padd ...
- flash8中利用遮罩制作图片切换效果
http://www.56.com/w73/play_album-aid-8642763_vid-NDY5ODU2Mzg.html
随机推荐
- (转载)深入理解MDL元数据锁
作者:MySQL技术本文为作者原创,转载请注明出处:https://www.cnblogs.com/kunjian/p/11993708.html 前言: 当你在MySQL中执行一条SQL时,语句并没 ...
- javascript 标签切换
* index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...
- php环境 安装
php 相关 wget https://www.php.net/distributions/php-7.2.16.tar.gz //你可以官网获取最新的包 tar解压 //一般目录 ...
- Modern PHP 使用生成器yield 处理csv文件 Generator
* 使用生成器处理csv文件 <?php function getRows($file) { $handle = fopen($file, 'rb'); if ($handle === fals ...
- 对帧率、I/P率、I帧间隔的理解
码率就是数据传输时单位时间传送的数据位数,一般我们用的单位是kbps即千位每秒.通俗一点的理解就是取样率,单位时间内取样率越大,精度就越高,处理出来的文件就越接近原始文件,但是文件体积与取样率是成正比 ...
- centos7 .net core 使用supervisor守护进程后台运行
安装supervisor yum install supervisor 配置supervisor vi /etc/supervisord.conf 拉到最后,这里的意思是 /etc/superviso ...
- [源码解析] PyTorch 流水线并行实现 (3)--切分数据和运行时系统
[源码解析] PyTorch 流水线并行实现 (3)--切分数据和运行时系统 目录 [源码解析] PyTorch 流水线并行实现 (3)--切分数据和运行时系统 0x00 摘要 0x01 分割小批次 ...
- P4180-[BJWC2010]严格次小生成树【Kruskal,倍增】
正题 题目链接:https://www.luogu.com.cn/problem/P4180 题目大意 \(n\)个点\(m\)条边的一张无向图,求它的严格次小生成树. \(1\leq n\leq 1 ...
- selenium--多窗口
多窗口/句柄 有些页面的链接打开后,会重新打开一个窗口,对于这种情况,想在新页面上操作,就得先切换窗口了.获取窗口的唯一标识用句柄表示,所以只需要切换句柄,我们就能在多个页面上灵活自如的操作了. 1. ...
- 深入浅出WPF-11.Template(模板)02
模板 DataTemplate和ControlTemplate的关系 通过上面的内容,控件只是一个数据和行为的载体,是一个抽象的概念,至于它长什么样子,或者它的数据是怎么展示的,都是由模板生成的.决定 ...