E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
Direct2d
Direct2D
(1) : 第一个例子
应该是Delphi2009就支持
Direct2D
了,但那时我还用着WinXP系统(不支持);现在的测试环境是Win7+DelphiXE。
涂孟超
·
2014-09-26 15:00
Direct2D
(13) : 画刷之 ID2D1BitmapBrush
{相关结构} TD2D1BitmapBrushProperties=record extendModeX:D2D1_EXTEND_MODE;//三个可选值分别是:0(延伸)、1(换行)、2(镜像) extendModeY:D2D1_EXTEND_MODE;//同上 interpolationMode:D2D1_BITMAP_INTERPOLATION_MODE;//拉伸图像时的差值算法:0
涂孟超
·
2014-09-26 15:00
Direct2D
(14) : 画笔
画笔类TDirect2DPen的Brush属性是TDirect2DBrush,现在的单色画笔其实是调用的实心画刷。因为画刷的强大,所以让画笔丰富起来不是难事。TDirect2DPen的StrokeStyle属性是ID2D1StrokeStyle类型,它决定着线帽、拐角样式等;但遗憾的是该属性是只读的,基本无用。但TDirect2DPen的Style属性还是巧妙实现了psSolid,psDash,p
涂孟超
·
2014-09-26 15:00
Direct2D
(3) : 使用浮点参数绘制基本图形
{相关方法} TDirect2DCanvas.DrawEllipse(); TDirect2DCanvas.DrawLine(); TDirect2DCanvas.DrawRectangle(); TDirect2DCanvas.DrawRoundedRectangle(); TDirect2DCanvas.FillEllipse(); TDirect2DCanvas.FillRect
涂孟超
·
2014-09-26 15:00
Direct2D
(30) : 判断几何对象的关系 - ID2D1Geometry.CompareWithGeometry()
{相关常量} //D2D1_GEOMETRY_RELATION=typeInteger; D2D1_GEOMETRY_RELATION_UNKNOWN=0;//未知 D2D1_GEOMETRY_RELATION_DISJOINT=1;//不相交 D2D1_GEOMETRY_RELATION_IS_CONTAINED=2;//属于 D2D1_GEOMETRY_RELATION_CONTAI
涂孟超
·
2014-09-26 15:00
Direct2D
(16) : 蒙版之 FillOpacityMask() 方法
实现蒙版效果有三种途径:使用FillOpacityMask()、使用FillGeometry()方法、使用图层。FillOpacityMask()用于处理图像蒙版。期间用到ID2D1Bitmap,因为对图像格式要求较高,我通过TDirect2DCanvas.CreateBitmap()建立ID2D1Bitmap时没有成功。后来使用了自定义函数直接使用WIC加载并转换格式。蒙版图片是透明图片,将会透
涂孟超
·
2014-09-26 15:00
Direct2D
(2) : 基本图形命令测试
Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms, Dialogs,StdCtrls,ExtCtrls,ComCtrls,TypInfo,
Direct2D
涂孟超
·
2014-09-26 15:00
Direct2D
(8) : 透明色
usesDirect2D,D2D1; procedureTForm1.FormPaint(Sender:TObject); var cvs:TDirect2DCanvas; R:TRect; begin cvs:=TDirect2DCanvas.Create(Canvas,ClientRect); cvs.BeginDraw; cvs.Pen.Color:=Color;
涂孟超
·
2014-09-26 15:00
Direct2D
(22) : 复合几何对象之 ID2D1TransformedGeometry
复合几何对象包括ID2D1GeometryGroup和ID2D1TransformedGeometry,它们都继承自ID2D1Geometry。ID2D1TransformedGeometry只是包含了2D变换的ID2D1Geometry。usesDirect2D,D2D1; procedureTForm1.FormPaint(Sender:TObject); var cvs:TDire
涂孟超
·
2014-09-26 15:00
Direct2D
(4) : DrawGeometry() 与 FillGeometry()
原始的
Direct2D
只提供了几种简单图形(直线、矩形、圆角矩形、椭圆)的绘制与填充,更多集合图形或路径的描绘要使用DrawGeometry()和FillGeometry()。
涂孟超
·
2014-09-26 15:00
Direct2D
(37) : 使用不同画刷绘制文本
usesDirect2D,D2D1; {建立位图画刷的函数} functionGetBitmapBrush(Canvas:TDirect2DCanvas;filePath:string):ID2D1BitmapBrush; var rBBP:TD2D1BitmapBrushProperties; bit:TBitmap; begin bit:=TBitmap.Create; b
涂孟超
·
2014-09-26 15:00
Direct2D
(19) : 图层之 TD2D1LayerParameters.geometricMask (使用几何图形剪裁图层)
usesDirect2D,D2D1; procedureTForm1.FormPaint(Sender:TObject); var cvs:TDirect2DCanvas; iLayer:ID2D1Layer; rLayerParameters:TD2D1LayerParameters; wic:TWICImage; R:TRect; iEllipse:ID2D1Ellipse
涂孟超
·
2014-09-26 15:00
Direct2D
(26) : 获取几何图形的边界
{相关方法} ID2D1Geometry.GetBounds();//获取边界矩形 ID2D1Geometry.GetWidenedBounds();//获取包含画笔区域的边界矩形测试代码:usesDirect2D,D2D1; procedureTForm1.FormPaint(Sender:TObject); var cvs:TDirect2DCanvas; iGeometry:
涂孟超
·
2014-09-26 15:00
Direct2D
(11) : 画刷之 ID2D1LinearGradientBrush
2、其Handle属性是
Direct2D
中的ID2D1Br
涂孟超
·
2014-09-26 15:00
Direct2D
(28) : 获取几何图形的面积、线总长度和指定位置的点坐标
usesDirect2D,D2D1; procedureTForm1.FormPaint(Sender:TObject); var cvs:TDirect2DCanvas; iEllipseGeometry:ID2D1EllipseGeometry; area,length:Single; rPointF1,rPointF2:TD2DPoint2f; ptCenter:TPoin
涂孟超
·
2014-09-26 15:00
Direct2D
(24) : 合并几何对象
合并通过ID2D1Geometry.CombineWithGeometry()完成,但返回的是ID2D1SimplifiedGeometrySink(ID2D1GeometrySink的父对象);需要把ID2D1SimplifiedGeometrySink添加到ID2D1PathGeometry才能使用。usesDirect2D,D2D1; procedureTForm1.FormPaint
涂孟超
·
2014-09-26 15:00
Direct2D
(33) : 通过 ID2D1BitmapRenderTarget 绘制背景网格
ID2D1BitmapRenderTarget是内存绘图的解决方案。它从ID2D1RenderTarget继承,只多出一个GetBitmap()方法。{相关方法} TDirect2DCanvas.RenderTarget.CreateCompatibleRenderTarget();//建立ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget.GetB
涂孟超
·
2014-09-26 15:00
Direct2D
(31) : 命中测试 - ID2D1Geometry.FillContainsPoint()、StrokeContainsPoint()
usesDirect2D,D2D1; const penWidth=25; var iGeometry:ID2D1EllipseGeometry; procedureTForm1.FormCreate(Sender:TObject); begin D2DFactory.CreateEllipseGeometry(D2D1Ellipse(D2D1PointF(120,90),8
涂孟超
·
2014-09-26 15:00
Direct2D
(23) : 复合几何对象之 ID2D1GeometryGroup
usesDirect2D,D2D1; procedureTForm1.FormPaint(Sender:TObject); var cvs:TDirect2DCanvas; iGeometryGroup:ID2D1GeometryGroup; arrGeometry:array[0..3]ofID2D1EllipseGeometry; ptCenter:TD2D1Point2F;
涂孟超
·
2014-09-26 15:00
Direct2D
(15) : 剪辑
绘制在RenderTarget.PushAxisAlignedClip()与RenderTarget.PopAxisAlignedClip()之间的内容将被指定的矩形剪辑。usesDirect2D,D2D1; procedureTForm1.FormPaint(Sender:TObject); var cvs:TDirect2DCanvas; R,RClip:TRect; begin
涂孟超
·
2014-09-26 15:00
Direct2D
(36) : RenderTarget.DrawText() 与 IDWriteTextFormat
TDirect2DCanvas提供了两种输出文本的方法:TextOut()、TextRect(),因太过高级,基本没有实用价值。TDirect2DCanvas.RenderTarget有三种输出文本的方法:DrawText()、DrawTextLayout()、DrawGlyphRun()。DrawText()对文本格式的控制能力类似TMemo;DrawTextLayout()对文本格式的控制能力
涂孟超
·
2014-09-26 15:00
Direct2D
(12) : 画刷之 ID2D1RadialGradientBrush
usesDirect2D,D2D1; procedureTForm1.FormPaint(Sender:TObject); var cvs:TDirect2DCanvas; iBrush:ID2D1RadialGradientBrush; R:TRect; rRGBP:TD2D1RadialGradientBrushProperties;//结构包含:中心点、偏移点、横向半径、纵向
涂孟超
·
2014-09-26 15:00
Direct2D
(43) : IDWriteGdiInterop 接口
IDWriteGdiInterop接口的主要用途是它提供IDWriteBitmapRenderTarget留出了HDC接口,以与GDI、GDI+交互;另提供了LOGFONT结构与IDWriteFont、IDWriteFontFace的相互转换的方法。IDWriteGdiInterop=interface(IUnknown) functionCreateFontFromLOGFONT({LOGFO
涂孟超
·
2014-09-26 15:00
Direct2D
(18) : 图层之 TD2D1LayerParameters.contentBounds (图层的有效范围)
{相关方法} TDirect2DCanvas.RenderTarget.CreateLayer();//建立层 TDirect2DCanvas.RenderTarget.PushLayer();//开始层;层的功能及效果取决于它的TD2D1LayerParameters结构参数 TDirect2DCanvas.RenderTarget.PopLayer();//结束层 {相关结构}
涂孟超
·
2014-09-26 15:00
Direct2D
(20) : 图层之 TD2D1LayerParameters.opacityBrush (为图层指定蒙版画刷)
usesDirect2D,D2D1; procedureTForm1.FormPaint(Sender:TObject); var cvs:TDirect2DCanvas; iLayer:ID2D1Layer; rLayerParameters:TD2D1LayerParameters; wic:TWICImage; R:TRect; iLinearGradientBrush:
涂孟超
·
2014-09-26 15:00
GdiPlus[1]: 一个给 Delphi 提供的、新的 GDI+ 接口, 很好用!
之前的版本下进行2D绘图还是离不开它,微软也没有停止对它的升级,随Vista的GDI版本是1.1(6.0.xxxx.x),新增了Blur等功能.不过Win7已经有了DirectD2D1,Delphi也同步有了
Direct2D
涂孟超
·
2014-09-26 15:00
Direct2D
(6) : 绘制质量(设置抗锯齿模式)
{相关方法} TDirect2DCanvas.RenderTarget.SetAntialiasMode(); TDirect2DCanvas.RenderTarget.GetAntialiasMode; {相关常量} D2D1_ANTIALIAS_MODE_PER_PRIMITIVE=0; D2D1_ANTIALIAS_MODE_ALIASED=1;测试代码:usesDirect2
涂孟超
·
2014-09-26 15:00
Direct2D
(5) : 绘制自定义图形
下面是通过自定义函数绘制菱形的测试代码。usesDirect2D,D2D1; {自定义的绘制菱形的函数} functionGetDiamondPath(ptLeft,ptTop:TD2DPoint2f):ID2D1PathGeometry;//返回路径接口 var sink:ID2D1GeometrySink;//给路径添加图形的接口 ptRight,ptBottom:TD2DPoi
涂孟超
·
2014-09-26 15:00
在Unity中使用
Direct2D
使用FreeType2等CPU计算的文字库一帧又画不了多少,毕竟还要提交到显存于是瞄准了
Direct2D
,当初学习这图像接口时就被微软说的“能与Direct3D进行完美
猪刚烈
·
2014-09-24 13:00
在Unity中使用
Direct2D
使用FreeType2等CPU计算的文字库一帧又画不了多少,毕竟还要提交到显存于是瞄准了
Direct2D
,当初学习这图像接口
langresser
·
2014-08-30 13:00
Direct2D
1.1 开发笔记 准备篇(一) 初始化
(准备篇提供
Direct2D
的基本操作,但是可能不会更新)
Direct2D
是一款笔者非常喜欢的图像API。在这里就写出D2D1.1版本的笔记,方便大家也是方便自己。
dustpg
·
2014-08-27 18:11
C++
开发笔记
Direct2D
基础知识
1、一个“字节”(Byte)是8位(bit),而一个“字”(Word)是32位(bit);2、DDraw.lib使8里的,2010SDK中用的
Direct2D
中,方法完全不同了,包含文件是d2d1.h,
墨云天
·
2014-06-12 16:00
DirectX和OpenGL
旗下包含了Direct3D、
Direct2D
、DirectCompute等等多个不同用途的子部分,因为这一系列API皆以Direct字样开头,所以DirectX(只要把X字母替换为任何一个特定API的名字
u013138260
·
2014-05-08 16:00
MSDN: Render Targets, Devices, and Resources什么是渲染目标,设备和资源
Direct2D
中的渲染目标是由ID2D1RenderTarget接口代表的。设备是一个抽象概念,代表实际执行显示pixels的对象。硬件设备就是GPU,软件设备就是C
kenden23
·
2013-12-21 08:00
resources
render
Devices
targets
设备和资源
什么是渲染目标
图形API的两种模式
图形API可以分为retained-modeAPIs(保存模式API)和immediate-modeAPIs(中间模式API).
Direct2D
是immediate-modeAPI,而WindowsPresentationFoundation
kenden23
·
2013-12-18 07:00
apis
apis
图形API的两种模式
retained-mode
保存模式API
中间模式API
和immediate-mode
杂谈SharpDx中的WIC组件——我们需要WIC的图片编码功能么?
在前文 SharpDX之
Direct2D
教程II——加载位图文件和保存位图文件 中,发现在VB2010中不能很好的运用SharpDx中的WIC组件进行图片的编码工作。
·
2013-10-08 14:00
sha
SharpDX之
Direct2D
教程II——加载位图文件和保存位图文件
本系列文章目录: SharpDX之
Direct2D
教程I——简单示例和Color(颜色) 绘制位图是绘制操作的不可缺少的一部分。
·
2013-10-07 14:00
sha
Direct2D
Direct2DDirect2D教程III——几何(Geometry)对象摘要:目前博客园中成系列的
Direct2D
的教程有1、万一的
Direct2D
系列,用的是Delphi20092、zdd的
Direct2D
·
2013-08-13 18:00
DI
绘制基本图形和线型(StrokeStyle)的设置详解
绘制基本图形和线型(StrokeStyle)的设置详解目前,在博客园上,相对写得比较好的两个关于
Direct2D
的教程系列,分别是万一的
Direct2D
系列和zdd的
Direct2D
系列。
·
2013-08-11 21:00
style
Direct2d
绘制图片的问题
网上看了不少资料,其中某篇是用笔刷画的。这样做仅适用于图片可以一次贴完的情况下。若想要贴图片的一部分必须要用到rendertarget的drawbimap方法。而不是用笔刷来画。如下的函数比较符合人类适用习惯voidDraw(constD2D1_RECT_F&rcDest,constD2D1_RECT_F&rcSrc) { //计算缩放值 //使用了默认参数,使用整张图片 D2D1_RECT_F
Augusdi
·
2013-06-06 16:00
Direct2D
图片处理
UsingBitmapBrushesDirect2D中的图片处理增加了很多的灵活的特性,现在的
Direct2D
可以很好的和GUI,GUI+以及Direct3D混合使用,它支持更多的图形格式,更丰富的绘制方法
Augusdi
·
2013-06-06 16:00
Direct2D
中Brushes Overview!笔刷~还是笔刷!
BrushTypesExample Win7中
Direct2D
的笔刷很丰富,效果也较以前买的版本漂亮了很多,在这个例题中,我们尝试绘制其中的几个笔刷: 以上几个笔刷分别是纯色,渐进色笔刷和辐射型笔刷。
Augusdi
·
2013-06-06 16:00
Direct2D
之Hello World
"HelloWorld"Sample 这个例子就是在Dx11的屏幕上输出一句话。在Dx11上写文字,估计微软下了不少功夫,生成了一堆乱七八糟的接口,因为资料不全,这里就不臆想它们的功能了,先向Dx11世界说一声"Hello~"吧~~ 这个例题中需要很多的新接口,所以加载的头文件有所增加,又增加了一个新的库dwrite.lib//Windows头文件: #include #include
Augusdi
·
2013-06-06 16:00
Direct2D
中的2D显示
现在的
Direct2D
更像是GDI了~~~ DX11上
Direct2D
的第一个例题就是绘制一个笔刷~~这在原来是不可能实现的;原来的ID3DxSprite只能够绘制基于纹理的格式,比如我们要做一个效果,
Augusdi
·
2013-06-06 15:00
Direct2D
编程入门
Direct2D
编程入门 例程代码下载 一.引言 早就听说
Direct2D
和DirectWrite
Augusdi
·
2013-06-06 15:00
Direct2D
中的坐标变换
Direct2D
中的坐标变换
Augusdi
·
2013-06-06 15:00
Direct2D
快速入门
原文:http://msdn.microsoft.com/en-us/library/windows/desktop/dd535473(v=vs.85).aspx转载请注明出处:
Direct2D
是用于创建
Augusdi
·
2013-06-06 15:00
DXGI的使用 --
Direct2D
和 Direct3D 互操作性概述
本主题说明如何通过使用
Direct2D
和 Direct3D(可能为英文网页),将二维图形和三维图形结合到一起。文章包含以下部分。
Augusdi
·
2013-06-06 14:00
解析在
Direct2D
中画Bezier曲线的实现方法
Direct2D
通过ID2D1RenderTarget接口支持基本图元(直线,矩形,圆角矩形,椭圆等)的绘制,然而,此接口并未提供对曲线绘制的直接支持。
·
2013-05-17 16:15
Direct2D
变换
可以通过矩阵变换来给几何图形作平移(Translation)、旋转(Rotate)、扭曲(Skew)和大小变换(Scale):ViewCode#include"stdafx.h" structSampleWindow :DesktopWindow { ComPtrm_geometry; ComPtrm_brush; voidCreateDeviceIndependentReso
·
2013-04-22 23:00
DI
上一页
1
2
3
4
5
6
7
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他