The below sample c# code demonstrates displaying a running clock over the main feed of a Decklink® card.
//Get first available Blackmagic Card.
DecklinkCard aCard = BMDevice.GetAvailableDevices()[0];
DecklinkStillSource StillSource = newDecklinkStillSource(aCard);
//Create a new empty bitmap and send it to decklink
BitmapaFrame =newBitmap(PalWidth, PalHeight, PixelFormat.Format32bppArgb);
StillSource.StartInternalKeying();
StillSource.Start(aFrame, PreviewLabel);
Graphicsg = Graphics.FromImage(aFrame);
while(isRunning)
{
//generate image containing new time.
g.Clear(Color.Transparent);
g.DrawString(DateTime.Now.ToLongTimeString(), aFont,Brushes.Yellow, 50, 50);
//send it to decklink.
StillSource.UpdateDisplayImage(aFrame);
Thread.Sleep(1000);//wait one second
}
|