- Posts: 17
- Joined: Wed Dec 10, 2014 2:15 pm
Hi,
I'm trying to use the internal key of a Decklink Studio 4k card, by API and VB.Net 2013 (FrameWork 3.5)
I'm able to obtain a reference to the IDecklink interface, to the IDecklinkOutput and IDecklinkKeyer ones.
The problem seems to be to create a good IDeckLinkMutableVideoFrame.
To do that, first of all I create it by CreateVideoFrame method of a IDecklinkOutput interface, by the following params:
CreateVideoFrame(720, 576, (720 * 4), DeckLinkAPI._BMDPixelFormat.bmdFormat8BitARGB, DeckLinkAPI._BMDFrameFlags.bmdFrameFlagFlipVertical, IVF)
where, of course, the IFV is a reference to a IDecklinkMutableVideoFrame. Just for a test, I'm using only a PAL resolution
Then I need to copy the data from an image file to the IDeckLinkMutableVideoFrame object, an I'm trying by:
Dim pBuffer As System.IntPtr
IVF.GetBytes(pBuffer)
Dim Stride As Integer = IVF.GetRowBytes
Dim V As New System.Drawing.Bitmap(IVF.GetWidth, IVF.GetHeight, Stride, Imaging.PixelFormat.Format32bppRgb, pBuffer)
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(V)
g.DrawImage(btm, 0, 0, btm.Width, btm.Height)
and then I dispose all the thing.
The btm variable is a bitmap obtained by the an image file.
the problem is that the image is shown, but the colors are not right. I've tried all the params for the System.Drawing.imaging.PixelFormat argument when I create a new bitmap, but without any good result.
Can you help me, please?
I'm trying to use the internal key of a Decklink Studio 4k card, by API and VB.Net 2013 (FrameWork 3.5)
I'm able to obtain a reference to the IDecklink interface, to the IDecklinkOutput and IDecklinkKeyer ones.
The problem seems to be to create a good IDeckLinkMutableVideoFrame.
To do that, first of all I create it by CreateVideoFrame method of a IDecklinkOutput interface, by the following params:
CreateVideoFrame(720, 576, (720 * 4), DeckLinkAPI._BMDPixelFormat.bmdFormat8BitARGB, DeckLinkAPI._BMDFrameFlags.bmdFrameFlagFlipVertical, IVF)
where, of course, the IFV is a reference to a IDecklinkMutableVideoFrame. Just for a test, I'm using only a PAL resolution
Then I need to copy the data from an image file to the IDeckLinkMutableVideoFrame object, an I'm trying by:
Dim pBuffer As System.IntPtr
IVF.GetBytes(pBuffer)
Dim Stride As Integer = IVF.GetRowBytes
Dim V As New System.Drawing.Bitmap(IVF.GetWidth, IVF.GetHeight, Stride, Imaging.PixelFormat.Format32bppRgb, pBuffer)
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(V)
g.DrawImage(btm, 0, 0, btm.Width, btm.Height)
and then I dispose all the thing.
The btm variable is a bitmap obtained by the an image file.
the problem is that the image is shown, but the colors are not right. I've tried all the params for the System.Drawing.imaging.PixelFormat argument when I create a new bitmap, but without any good result.
Can you help me, please?
Maurizio Bianchella
Italy
Italy