本文介绍了在屏幕外绘制时是否可以获取TextFormattingMode = Display(例如RenderTargetBitmap)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在WPF中绘制某些图像,这些图像将由游戏(由第三方开发)显示.我目前使用RenderTargetBitmap生成图像.不幸的是,这似乎仅支持Ideal文本格式设置模式,从而导致模糊的小字体.该应用程序是第三方游戏,因此无法使用图像.

I'm drawing certain images in WPF which will be displayed by a game (developed by a third party). I currently produce the images using a RenderTargetBitmap. Unfortunately it seems that this only supports the Ideal text formatting mode, resulting in blurry small fonts. The application is a third-party game and thus there's no way around using images.

我可以告诉RenderTargetBitmap假设它绘制的图像是发给当前商人的吗?有没有其他方法可以使WPF使用Display渲染模式进行屏幕外绘制?

Can I tell the RenderTargetBitmap to assume that it's drawing an image destined for one of the current montiors? Is there another way to get WPF to use the Display rendering mode for off-screen drawing?

我理解为什么从理论上讲这似乎是错误的,但是在实践中我有理由认为这不是不合理的事情:

I understand why this might seem wrong in the theoretical sense, but in practice there are reasons why I think this is not an unreasonable thing to do:

  • Display模式允许的功能之一是别名文本,该别名文本在小尺寸上比Ideal呈现效果更好,并且完全独立于诸如gamma的监视器属性.
  • 任何屏幕上,即使在使用不同的伽玛值的屏幕上,用ClearType呈现的小Display模式文本的屏幕截图也比Ideal模式文本好得多.
  • One of the things the Display mode allows is aliased text, which looks better at small sizes than the Ideal rendering, and is completely independent of monitor properties such as gamma.
  • A screenshot of small Display-mode text rendered in ClearType looks far better on any screen, even those with different gamma, than Ideal-mode text.

WPF渲染引擎可以做到这一点,还是我必须依靠GDI? (在屏幕外使用Aliased或ClearType渲染没有困难)

Can the WPF rendering engine do this, or do I have to fall back onto GDI? (which has no difficulties with using Aliased or ClearType rendering off-screen)

推荐答案

当然没有显而易见的方法.我想绘制图像从来都不是WPF的目标.在大多数情况下,它实际上可以做得很好的事实一定是偶然的.

There is certainly no obvious way of doing this. I guess drawing to images was never a goal of WPF; the fact that it can actually do this fairly well most of the time must be accidental.

这篇关于在屏幕外绘制时是否可以获取TextFormattingMode = Display(例如RenderTargetBitmap)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 12:47
查看更多