Click to See Complete Forum and Search --> : How to display a InteropBitmap in a Windows Form
BossOfTheGame
February 1st, 2010, 05:52 PM
I haven't used C# in awhile. So, to get back into it I am writing an application using CLEyeCamera API for the PS3 Eye Toy. The API returns a InteropBitmap. I want to display the image in a panel. I would normally do this by overriding the paint event and using e.Graphics.DrawImage();
What is the right way to go about displaying this in C#?
BigEd781
February 1st, 2010, 06:25 PM
I have never done this, but glancing at the documentation for the InteropBitmap class I see a method named "CopyPixels" which may be used to copy the pixel data into an array. Once you have that array you essentially have all that you need and can create a Bitmap object in a number of ways. Here are a few of them (saves me the typing :))
http://www.vbforums.com/showthread.php?t=358917
BossOfTheGame
February 1st, 2010, 09:45 PM
Well, this solution semiworks. I still have to mess around with parameters to see what bitmap format it is in. The only problem is that the windows encounters a flickering problem because I have to repaint the window every time the image changes.
BigEd781
February 2nd, 2010, 01:02 AM
You should be double buffering if you need to repaint very often. As for the format... the API should have that documented, no?
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.