Delphi 与 DirectX 之 DelphiX(83): TDIB.FilterLine()、FilterRect();
本例效果图:
代码文件:
unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, DIB, StdCtrls;typeTForm1 = class(TForm)DXPaintBox1: TDXPaintBox;Button1: TButton;procedure FormCreate(Sender: TObject);procedure FormDestroy(Sender: TObject);procedure Button1Click(Sender: TObject);end;varForm1: TForm1;implementation{$R *.dfm}uses TypInfo;vardib: TDIB;f: Integer;procedure TForm1.Button1Click(Sender: TObject); constclr = clRed; varw,h,a,b: Integer; beginDXPaintBox1.DIB.Assign(dib);w := DXPaintBox1.ClientWidth;h := DXPaintBox1.ClientHeight;a := w div 7;b := h div 7;DXPaintBox1.DIB.FilterLine(0, b, w, b, clr, TFilterMode(f));DXPaintBox1.DIB.FilterLine(0, h-b, w, h-b, clr, TFilterMode(f));DXPaintBox1.DIB.FilterLine(a, 0, a, h, clr, TFilterMode(f));DXPaintBox1.DIB.FilterLine(w-a, 0, w-a, h, clr, TFilterMode(f));DXPaintBox1.DIB.FilterRect(w div 5, h div 5, w div 5*3, h div 5*3, clr, TFilterMode(f));DXPaintBox1.Repaint;Text := GetEnumName(TypeInfo(TFilterMode), f);Inc(f); f := f and 3; end;procedure TForm1.FormCreate(Sender: TObject); constImgPath1 = 'C:\Temp\DX.jpg'; begindib := TDIB.Create;dib.LoadFromFile(ImgPath1);DXPaintBox1.DIB.Assign(dib);DXPaintBox1.Width := dib.Width;DXPaintBox1.Height := dib.Height;DXPaintBox1.Repaint; end;procedure TForm1.FormDestroy(Sender: TObject); begindib.Free; end;end.
窗体文件:
object Form1: TForm1Left = 0Top = 0Caption = 'Form1'ClientHeight = 142ClientWidth = 226Color = clBtnFaceFont.Charset = DEFAULT_CHARSETFont.Color = clWindowTextFont.Height = -11Font.Name = 'Tahoma'Font.Style = []OldCreateOrder = FalseOnCreate = FormCreateOnDestroy = FormDestroyPixelsPerInch = 96TextHeight = 13object DXPaintBox1: TDXPaintBoxLeft = 8Top = 8Width = 81Height = 73AutoStretch = FalseCenter = FalseKeepAspect = FalseStretch = FalseViewWidth = 0ViewHeight = 0endobject Button1: TButtonLeft = 143Top = 101Width = 75Height = 25Caption = 'Button1'TabOrder = 0OnClick = Button1Clickend end
Delphi 与 DirectX 之 DelphiX(83): TDIB.FilterLine()、FilterRect();相关推荐
- Delphi 与 DirectX 之 DelphiX(25): TDIB.Blur();
DelphiX 的组件面板上, 第二个就是 TDXDIB; TDXDIB.DIB 是 TDXDIB 的唯一属性(其他是 TComponent 固有的); TDXDIB.DIB 属性是一个 TDIB 对 ...
- Delphi 与 DirectX 之 DelphiX(89): TDIB.DrawAlphaMask();
本例效果图: 代码文件: unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Contr ...
- Delphi 与 DirectX 之 DelphiX(95): TDIB.x
//让 TDIB 的这些特效烦透了: 多.还重复.又不完善; 还没有测试或测试失败的方法: procedure DrawShadow(SrcDIB: TDIB; X, Y, Width, Height ...
- Delphi 与 DirectX 之 DelphiX(33): TDIB.SmoothRotateWrap();
本例效果图: 代码文件: unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Contr ...
- Delphi 与 DirectX 之 DelphiX(93): TDIB.DrawDarken();
本例效果图: 代码文件: unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Contr ...
- Delphi 与 DirectX 之 DelphiX(77): TDIB.Distort();
本例效果图: 代码文件: unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Contr ...
- Delphi 与 DirectX 之 DelphiX(52): TDIB.DoSaturation();
本例效果图: 代码文件: unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Contr ...
- Delphi 与 DirectX 之 DelphiX(35): TDIB.Saturation();
本例效果图: 代码文件: unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Contr ...
- Delphi 与 DirectX 之 DelphiX(72): TDIB.SephiaEffect();
为什么80%的码农都做不了架构师?>>> 本例效果图: 代码文件: unit Unit1;interfaceusesWindows, Messages, SysUtils, V ...
最新文章
- 外国人工作证延期、办理外国人居留许可延期
- Luogu P1115 最大子段和(dp 贪心)
- ubuntu16.04下安装openssh-server报依赖错误的解决方法
- xlrd读取所有sheet名_如何在Python对Excel进行读取
- 数字电路基础知识——锁存器与触发器的建立时间和保存时间(一)
- windows录屏_电脑是怎么录屏的呢?推荐三个录屏实用方法!
- 软考中级软件设计师备考详细资料
- 数据采集卡的模拟输入信号到底应该怎么接线
- 真香!微软办公环境大揭秘!
- 抽象类(abstract)
- word无法显示下划线
- 积极心态的力量——杨吉
- React移动端端局域网手机访问测试
- 如何成为早起者(二)
- kettle在linux下启动报错libwebkitgtk-1.0-0
- 【网课平台】Day16.项目优化:压测、加缓存优化与分布式锁
- SpaceVim 中文教程
- 弘辽科技跨境电商创业,你了解多少?看老司机怎么说
- 用风格迁移搞事情!超越艺术字:卷积神经网络打造最美汉字
- 全网首发,大众奥迪领驭帕萨特DIY数码碟盒增加USB和蓝牙播放音乐功能使用原车接口无损改装
热门文章
- MySQL表设计基础
- Python网络编程之TCP通信实例和socketserver框架使用例子
- ArcGIS for Android 中实现要素绘制时固定MapView
- 数据库递归查询(CET)
- ORACLE新增DATABASE LINK
- shellcode xor编码/解码[1]
- DATE_FORMAT、when case函数用法
- PAT1087 All Roads Lead to Rome (30)(最短路径+dfs+回溯)
- inheritConstructorStealing.js
- 【转载】强大的MongoDB数据库管理工具