如何写一个(位图?)图像更快的GDI +显示缓冲区? [英] How to write to a (Bitmap?) image buffer for faster GDI+ displays?

查看:271
本文介绍了如何写一个(位图?)图像更快的GDI +显示缓冲区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用C ++和.NET我有一个数据流我想显示为一个滚动的图像。每次我得到一些新的数据我想将其添加为新行(128x1像素),并滚动previous内容一边去了。

Using C++ and .net I have a stream of data I want to display as a scrolling image. Each time I get some new data I want to add it as a new row (128x1 pixels) and scroll the previous contents to one side.

这个问题我的第一个短片参与渲染我有一个新的行每次整个数据集。这个工作,但速度太慢,所以我想它可能会更有意义写信给某种缓冲区(可能是位图?)。问题是,我不看我怎么能做到这一点; 图形 对象可以绘制相当愉快,但我不能看到一个明显的方式来告诉我的控制使用的 位图 的对象,因为它的缓冲?同样的,我看不到的方式来画一个位图,我可以写,然后在屏幕上。

My first stab at the problem involved rendering the entire data set each time I got a new row. This worked, but was far too slow, so I'm thinking it might make more sense to write to a buffer of some sort (a bitmap maybe?). The problem is that I can't see how I can do that; Graphic objects allow you to draw quite happily, but I can't see an obvious way to tell my control to use a Bitmap object as it's buffer? Similarly, I can't see a way to draw on a bitmap which I could then write to the screen.

这必须是可能的,但我的谷歌,富失败我迄今为止...

This must be possible, but my google-foo has failed me thus far...

只是为了澄清,该数据是一个光谱。下图显示了之类的事情,我想实现:

Just to clarify, the data is a spectrogram. The following image shows the sort of thing I was trying to achieve:

替代文字/

我策划的数据来自于彩车的数组。没有什么限制,我会多少得到,所以我只是想忘记的数据,因为它脱落情节的一面。

The data I'm plotting comes in arrays of floats. There's nothing to limit how many I'll get, so I just want to forget data as it drops off the side of the plot.

目前,我从 继承系统:视窗:形式:用户控件 ,但可以切换到别的东西,如果有一个更好的变质?

I'm currently inheriting from a System::Windows::Forms::UserControl, but could switch to something else if there's a better alterative?

推荐答案

看看的的滚屏 win32的方法。可以在屏幕上滚动的现有数据,然后仅绘制新的数据。这是的非常的快。

Take a look at the ScrollWindow win32 method. You can scroll the existing data on the screen and then draw only the new data. This is very fast.

这篇关于如何写一个(位图?)图像更快的GDI +显示缓冲区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆