一、CompositingMode

获取一个值,该值指定如何将合成图像绘制到此 Graphics。复合模式确定从源映像的像素是覆盖(SourceCopy)还是组合(SourceOver, 需要使用半透明、混合叠加效果时使用)使用背景像素。默认值为 SourceOver

该属性适用于 适用于.NET Framework 4.7.2, 4.7.1, 4.7, 4.6.2, 4.6.1, 4.6, 4.5.2, 4.5.1, 4.5, 4.0, 3.5, 3.0, 2.0, 1.1

不应使用CompositingMode属性值为SourceCopyTextRenderingHint属性设置为ClearTypeGridFit。 可能会发生异常或图像可能无法正确呈现。

二、CompositingQuality

获取或设置绘制到此 Graphics 的合成图像的呈现质量。组合的情况下质量决定将合成图像的呈现质量级别。

CompositingQuality Enum

AssumeLinear 4

假定线性值。

Default 0

默认质量。

GammaCorrected 3

使用灰度校正。

HighQuality 2

高质量、低速度复合。

HighSpeed 1

高速度、低质量。

Invalid -1

无效质量。

Compositing is done during rendering when the source pixels are combined with the destination pixels to produce the resultant pixels.

The quality of compositing directly relates to the visual quality of the output and is inversely proportional to the render time. The higher the quality, the slower the render time. This is because the higher the quality level, the more surrounding pixels need to be taken into account during the composite. The linear quality setting (AssumeLinear) compromises by providing better quality than the default quality at a slightly lower speed.
 

三、InterpolationMode

The interpolation mode determines how intermediate values between two endpoints are calculated.

四、SmoothingMode

平滑模式指定直线、 曲线和已填充区域的边缘是否使用平滑处理 (也称为抗锯齿)。 一个例外是路径渐变画笔不遵守平滑模式。 使用填充的区域PathGradientBrush呈现相同的方式 (别名) 而不考虑SmoothingMode属性。

五、TextRenderingHint

The text rendering hint specifies whether text renders with antialiasing.

Note:

You should not use a CompositingMode property value of SourceCopy when the TextRenderingHint property is set to ClearTypeGridFit. An exception could occur or the image may not render correctly.

六、TextContrast

The gamma correction value used for rendering antialiased and ClearType text.

private void ChangeTextRenderingHintAndTextContrast(PaintEventArgs e)
{ // Retrieve the graphics object.
Graphics formGraphics = e.Graphics; // Declare a new font.
Font myFont = new Font(FontFamily.GenericSansSerif, , FontStyle.Regular); // Set the TextRenderingHint property.
formGraphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixel; // Draw the string.
formGraphics.DrawString("Hello World", myFont, Brushes.Firebrick, 20.0F, 20.0F); // Change the TextRenderingHint property.
formGraphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; // Draw the string again.
formGraphics.DrawString("Hello World", myFont, Brushes.Firebrick, 20.0F, 60.0F); // Set the text contrast to a high-contrast setting.
formGraphics.TextContrast = ; // Draw the string.
formGraphics.DrawString("Hello World", myFont,
Brushes.DodgerBlue, 20.0F, 100.0F); // Set the text contrast to a low-contrast setting.
formGraphics.TextContrast = ; // Draw the string again.
formGraphics.DrawString("Hello World", myFont, Brushes.DodgerBlue, 20.0F, 140.0F); // Dispose of the font object.
myFont.Dispose(); }

参考资料

MSDN .NET 4.7.2, 18.9.20

C# Graphics中有关绘图质量的几个Mode的更多相关文章

  1. Java知多少(98)Graphics类的绘图方法

    Graphics类提供基本绘图方法,Graphics2D类提供更强大的绘图能力.本节讲解Graphics类,下节讲解Graphics2D. Graphics类提供基本的几何图形绘制方法,主要有:画线段 ...

  2. Java的Graphics类进行绘图的方法详解

    Graphics类提供基本绘图方法,Graphics2D类提供更强大的绘图能力. Graphics类提供基本的几何图形绘制方法,主要有:画线段.画矩形.画圆.画带颜色的图形.画椭圆.画圆弧.画多边形等 ...

  3. 十一. 图形、图像与多媒体4.Graphics类的绘图方法

    Graphics类提供基本绘图方法,Graphics2D类提供更强大的绘图能力.本节讲解Graphics类,下节讲解Graphics2D. Graphics类提供基本的几何图形绘制方法,主要有:画线段 ...

  4. Android中Canvas绘图基础详解(附源码下载) (转)

    Android中Canvas绘图基础详解(附源码下载) 原文链接  http://blog.csdn.net/iispring/article/details/49770651   AndroidCa ...

  5. 【《Effective C#》提炼总结】提高Unity中C#代码质量的21条准则

    作者:Williammao, 腾讯移动客户端开发工程师 商业转载请联系腾讯WeTest获得授权,非商业转载请注明出处. 原文链接:http://wetest.qq.com/lab/view/290.h ...

  6. OpenCV中的绘图函数-OpenCV步步精深

    OpenCV 中的绘图函数 画线 首先要为画的线创造出环境,就要生成一个空的黑底图像 img=np.zeros((512,512,3), np.uint8) 这是黑色的底,我们的画布,我把窗口名叫做i ...

  7. 【《Effective C#》提炼总结】提高Unity中C#代码质量的22条准则

    引言 原则1尽可能地使用属性而不是可直接访问的数据成员 原则2偏向于使用运行时常量而不是编译时常量 原则3 推荐使用is 或as操作符而不是强制类型转换 原则4 推荐使用条件属性而不是if条件编译 原 ...

  8. 【转】Effective C#观后感之提高Unity中C#代码质量的21条准则

    转自:http://blog.csdn.net/swj524152416/article/details/75418162 我们知道,在C++领域,作为进阶阅读材料,必看的书是<Effectiv ...

  9. 【Matlab开发】matlab中bar绘图设置与各种距离度量

    [Matlab开发]matlab中bar绘图设置与各种距离度量 标签(空格分隔): [Matlab开发] [机器学习] 声明:引用请注明出处http://blog.csdn.net/lg1259156 ...

随机推荐

  1. 每天一个linux命令(权限):【转载】chgrp命令

    在lunix系统里,文件或目录的权限的掌控以拥有者及所诉群组来管理.可以使用chgrp指令取变更文件与目录所属群组,这种方式采用群组名称或群组识别码都可以.Chgrp命令就是change group的 ...

  2. pip 在windows下的更新升级

    1. pip 在 PyCharm 无法自动更新 2.   https://pip.pypa.io/en/latest/installing.html 官方网页要求在 cmd中输入以下命令进行 pip的 ...

  3. 通过以太坊发行代币(token)

    2017年开始,区块链ICO项目层出不穷,市场热度一波更胜一波,很多ICO都是通过以太坊智能合约发行自己的代币(token),具体怎样才能发行代币呢?本文进行具体详细的介绍. 准备工作 以太坊官网ER ...

  4. String.format()格式化日期(2)

    在以前的开发中,日期格式化一直使用的是SimpleDateFormat进行格式化.今天发现String.format也可以格式化.当 然,两种方式的优劣没有进行深入分析. 1. 日期格式化 (2018 ...

  5. 【DUBBO】zookeeper在dubbo中作为注册中心的原理结构

    [一]原理图 [二]原理图解释 流程:1.服务提供者启动时向/dubbo/com.foo.BarService/providers目录下写入URL2.服务消费者启动时订阅/dubbo/com.foo. ...

  6. spring注解实现业务层事务管理,当业务层自调用时,事务失效问题解决

    前些日子一朋友在需要在目标对象中进行自我调用,且需要实施相应的事务定义,且网上的一种通过BeanPostProcessor的解决方案是存在问题的.因此专门写此篇帖子分析why. 1.预备知识 aop概 ...

  7. 安装WampServer关闭mysql服务后打不开了(端口冲突)

    1.WampServer自带了mysql精简班的数据库了 2.WampServer自带 的mysql和你独立安装的mysql端口号冲突了 3.mysql默认的端口号是3306 4.建议你修改WampS ...

  8. 构建docker私有库

    前提: ip:     172.16.0.9 docker:   Version:  18.05.0-ce   1下载registry  docker pull registry   2 建库 将库像 ...

  9. odoo 使用源码安装时的注意

    odoo 使用源码安装时的注意 使用 odoo 源安装 odoo 时,会增加 odoo 官方的 odoo 源. 安装时直接输入 yum install odoo 即可安装 odoo. 但是更新时就要注 ...

  10. 关于angular.extend的用法

    ng中的ng-function中会有些方法,便于我们进行js代码的编写 关于angular.extend(dst, src);通过从src对象复制所有属性到dst来扩展目标对象dst.你可以指定多个s ...