博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Delphi 与 DirectX 之 DelphiX(31): TDIB.Twist();
阅读量:6116 次
发布时间:2019-06-21

本文共 1906 字,大约阅读时间需要 6 分钟。

  hot3.png

本例效果图:
26153933_b54e.gif

代码文件:

unit Unit1;interfaceuses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, DIB, StdCtrls;type  TForm1 = class(TForm)    DXPaintBox1: TDXPaintBox;    Button1: TButton;    Button2: TButton;    procedure Button1Click(Sender: TObject);    procedure Button2Click(Sender: TObject);    procedure FormCreate(Sender: TObject);    procedure FormDestroy(Sender: TObject);  end;var  Form1: TForm1;implementation{$R *.dfm}var  dib: TDIB;procedure TForm1.Button1Click(Sender: TObject);const  ImgPath1 = 'C:\Temp\DX.jpg';begin  dib.LoadFromFile(ImgPath1);  DXPaintBox1.DIB.Assign(dib);  DXPaintBox1.Width := dib.Width;  DXPaintBox1.Height := dib.Height;  DXPaintBox1.Repaint;end;procedure TForm1.Button2Click(Sender: TObject);begin  DXPaintBox1.DIB.Twist(dib, 128);  DXPaintBox1.DIB.Assign(dib);  DXPaintBox1.Repaint;end;procedure TForm1.FormCreate(Sender: TObject);begin  dib := TDIB.Create;end;procedure TForm1.FormDestroy(Sender: TObject);begin  dib.Free;end;end.
窗体文件:

object Form1: TForm1  Left = 0  Top = 0  Caption = 'Form1'  ClientHeight = 142  ClientWidth = 226  Color = clBtnFace  Font.Charset = DEFAULT_CHARSET  Font.Color = clWindowText  Font.Height = -11  Font.Name = 'Tahoma'  Font.Style = []  OldCreateOrder = False  OnCreate = FormCreate  OnDestroy = FormDestroy  PixelsPerInch = 96  TextHeight = 13  object DXPaintBox1: TDXPaintBox    Left = 8    Top = 8    Width = 81    Height = 73    AutoStretch = False    Center = False    KeepAspect = False    Stretch = False    ViewWidth = 0    ViewHeight = 0  end  object Button1: TButton    Left = 143    Top = 78    Width = 75    Height = 25    Caption = 'Button1'    TabOrder = 0    OnClick = Button1Click  end  object Button2: TButton    Left = 143    Top = 109    Width = 75    Height = 25    Caption = 'Button2'    TabOrder = 1    OnClick = Button2Click  endend

转载于:https://my.oschina.net/hermer/blog/320847

你可能感兴趣的文章
Vue之项目搭建
查看>>
app内部H5测试点总结
查看>>
Docker - 创建支持SSH服务的容器镜像
查看>>
[TC13761]Mutalisk
查看>>
三级菜单
查看>>
Data Wrangling文摘:Non-tidy-data
查看>>
加解密算法、消息摘要、消息认证技术、数字签名与公钥证书
查看>>
while()
查看>>
常用限制input的方法
查看>>
Ext Js简单事件处理和对象作用域
查看>>
IIS7下使用urlrewriter.dll配置
查看>>
12.通过微信小程序端访问企查查(采集工商信息)
查看>>
WinXp 开机登录密码
查看>>
POJ 1001 Exponentiation
查看>>
HDU 4377 Sub Sequence[串构造]
查看>>
云时代架构阅读笔记之四
查看>>
WEB请求处理一:浏览器请求发起处理
查看>>
Lua学习笔记(8): 元表
查看>>
PHP经典算法题
查看>>
LeetCode 404 Sum of Left Leaves
查看>>