【发布时间】:2013-11-06 14:45:17
【问题描述】:
我想在不使用 WIC 的情况下执行以下操作:
-
创建一个 Direct2D1 位图并在其中绘制一些东西。
BitmapProperties props = new BitmapProperties(new SharpDX.Direct2D1.PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied)); var renderT = new SharpDX.Direct2D1.BitmapRenderTarget(m_d2dRenderTargetImage, CompatibleRenderTargetOptions.None, new SharpDX.Direct2D1.PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied)); renderT.BeginDraw(); renderT.Clear(SharpDX.Color.Yellow); renderT.EndDraw(); -
将此位图保存到变量中。
RastImage = new SharpDX.Direct2D1.Bitmap(renderT, new Size2(targetWidth, targetHeight), props); -
将此位图绘制到 Direct2D RenderTarget 中。
m_d2dRenderTarget = new RenderTarget(m_d2dFactory, surface, rtp);
但这并没有做任何事情。有人可以告诉我我做错了什么吗?它甚至可以在没有 WIC 的情况下工作吗?欢迎任何帮助。我搜索了很多,但从未真正找到没有 WIC 的示例。
【问题讨论】:
标签: c# bitmap direct2d sharpdx