getPixel setPixel 太慢,.NET CF 上还有其他替代方案吗
我正在使用 Bitmap Class' .setPixel 和 .getPixel 在 .NET CF 上绘制位图字体。但它太慢了,在java中我们有 getRGB() 和 setRGB() 来通过一次调用来设置颜色数组。 .NET CF 中有类似的东西吗?我的要求只是将位图的一部分绘制到指定 x,y 处的另一个位图中。
编辑:源图像具有透明度(不是 alpha,只是简单的透明度)。
I'm using Bitmap Class' .setPixel and .getPixel to draw my bitmap fonts on .NET CF. But it is too slow, in java we have getRGB() and setRGB() to set array of colors with a single call. Is there something like that in .NET CF. My requirement is simply to draw a portion of a bitmap into another bitmap at specified x,y.
EDIT: The source image have transparancy (not alpha but just simple transparency).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不要滚动自己的循环。您应该能够使用 ImageAttributes 属性运行 DrawImage 方法,设置正确的颜色键(白色、紫色,无论您在图像中使用什么)。
Don't roll your own loop. You should be able to run the DrawImage method with the ImageAttributes attribute, setting the correct color key (white, purple, whatever you use in your image).
不要使用 for 循环执行您自己的“blit”并获取/设置像素!
使用
Graphics.FromImage()
并使用DrawImage( )
。Don't do your own 'blit' with a for loop and get/set pixels!
Use
Graphics.FromImage()
and draw the other bitmap into it usingDrawImage()
.使用位图、BitBlt 功能。我在此处中展示了一个示例。
Use bitmap, BitBlt functionality. I show an example in here.