问题
I am trying to create an application to display 8/16bit grayscale video. Currently, I create a BMP bitmap as RGB48 from frames, and simply assign
pictureBox.Image = bmp
This requires to create three redundant channels to make an RGB image look like grayscale (the grayscale image formats do not seem to work). This approach works on my fast computer, but slower computers can not keep up. So, I was hoping that someone could advise a better way of how to display images fast and efficient.
In my previous question, I was advised to display images on a panel using onPaint event, instead of picturebox. However, I still did not figure out how to do it.
- Is there a way to avoid creating three color channel for RGB if it is to be displayed as a grayscale?
- If I place a panel component on the current form, how to create an Onpaint event so the panel displays the image?
The general functioning of my program is as follows: One thread receives the image data and the other thread collects this data into a larger byte array. As soon as the larger array contains enough data for a full frame, I display the image.
来源:https://stackoverflow.com/questions/33401235/what-is-the-optimal-way-to-display-images-fast-c