一、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. OK335xS knob driver hacking

    /************************************************************************* * OK335xS knob driver hac ...

  2. Git-Svn 建立工作目录

    使用Git-SVN 建立工作目录 GIT-SVN可以以SVN的版本为基础, 实现”私有”的版本管理功能. 这样一些不成熟但又需要记录的版本就不必提交到SVN上, 而只在自己本地私有的版本里出现. 下面 ...

  3. LOJ2422 NOIP2015 斗地主 【搜索+贪心】*

    LOJ2422 NOIP2015 斗地主 LINK 题目大意很简单,就是问你斗地主的一分手牌最少多少次出完 然后我们发现对于一种手牌状态,不考虑顺子的情况是可以贪心做掉的 然后我们直接枚举一下顺子出牌 ...

  4. 集群搭建SSH的作用及这些命令的含义

    authorized_keys文件 远程主机将用户的公钥,保存在登录后的用户主目录的$HOME/.ssh/authorized_keys文件中.公钥就是一段字符串,只要把它追加在authorized_ ...

  5. Kalman Filter

    本质是一种最优估计法.  核心是"预测"+"测量反馈". 一个视频: http://blog.sina.com.cn/s/blog_461db08c0102uw ...

  6. bzoj 3671 [Noi2014]随机数生成器——贪心(时间复杂度分配)

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3671 设 x 为一个点的行号, y 为一个点的列号:原本想着判断一个点能不能选就是看选了的点 ...

  7. volatile浅析

    volatile的意思是不稳定的.易变的,但在多线程中却跟字面意思一毛钱关系没有.作为一个变量修饰符,它主要有两个作用:一个是告诉大家,该变量是一个在多个线程之间均可见的变量:另一个是告诉java虚拟 ...

  8. jQuery实现清空table表格除首行外的所有数据

    1.其实网上有很多版本,试了好几个都不行,最后还是查到了一个非常方便的:不会清除表格第一行表头部分. 其中J_tab_fam是table的id. ? 1 $("#J_tab_fam  tr: ...

  9. erlang的一些小技巧(不定期更新)

    在任意节点热更新代码 rpc:call(Node,c,l,[Mod]) c和l的指的是code,library Erlang Shell隐藏的小技巧 f(). %%把所有绑定变量释放掉 f(Val). ...

  10. vim 编辑技巧

    vi是linux下最常用的编辑器,vim是vi的加强版,本篇将介绍vim的一些快捷键和使用技巧,借鉴网上其他文章表示