dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: How to display a InteropBitmap in a Windows Form

  1. #1
    Join Date
    Apr 2007
    Posts
    52

    How to display a InteropBitmap in a Windows Form

    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#?
    KTNXBYE

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: How to display a InteropBitmap in a Windows Form

    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

  3. #3
    Join Date
    Apr 2007
    Posts
    52

    Re: How to display a InteropBitmap in a Windows Form

    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.
    KTNXBYE

  4. #4
    Join Date
    Jun 2008
    Posts
    2,477

    Re: How to display a InteropBitmap in a Windows Form

    You should be double buffering if you need to repaint very often. As for the format... the API should have that documented, no?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)