What can I use instead of picturebox to real time streaming in c # winform?

584 Views Asked by At

When I stream with the picturebox, there is a decrease in performance. I'm looking for a library that supports 4k 30fps. I think Opengl will support it. I shared my code below. I need a higher performance viewer instead of Picturebox. Are examples of this available for Opengl?

I have a c ++ dll. I convert the 4k 30fps data from gstreamer to bitmap and print it to the screen.

pt = DLLWrapper.WrapperSingleCameras (0) is returning the 4k30fps frame from the stream as a pointer.

pt = DLLWrapper.WrapperSingleCameras(0);
    BitmapSingleImage = new Bitmap(rsSplitWidth, rsSplitHeight, rsSplitWidth, System.Drawing.Imaging.PixelFormat.Format8bppIndexed, (IntPtr)pt);
                             
    ColorPalette _palette = BitmapSingleImage.Palette;
    System.Drawing.Color[] _entries = _palette.Entries;

    for (int m = 0; m < 256; m++)
    {
        System.Drawing.Color b = new System.Drawing.Color();
        b = System.Drawing.Color.FromArgb((byte)m, (byte)m, (byte)m);
        _entries[m] = b;
    }

    BitmapSingleImage.Palette = _palette;

    videosGUI.videoPictureBox.Image = BitmapSingleImage;
    videosGUI.videoPictureBox.Refresh();
0

There are 0 best solutions below