I'd like to insert subtitle into the media file without using Library that provides it automatically(Like a DirectShow)
I used way to draw by using window desktop's drawing handle, but it couldn't work. I think it is because of the speed of update... right? Anyway, is there any function or method to paint over a media file or get their overlay handle?
[DllImport("user32.dll")]
static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll")]
static extern IntPtr GetDCEx(IntPtr hwnd, IntPtr hrgn, uint flags);
[DllImport("user32.dll")]
static extern IntPtr ReleaseDC(IntPtr hwnd, IntPtr hdc);
public void SubtitleDraw()
{
IntPtr hWnd = GetDesktopWindow();
IntPtr hDc = GetDCEx(hWnd, IntPtr.Zero, 1027);
Font font1 = new Font("Times New Roman", 24, FontStyle.Regular,GraphicsUnit.Pixel);
Point pt = new Point(40, 375);
PointF pointF1 = new PointF();
pointF1 = PlayerForm.ActiveForm.PointToScreen(pt);
Graphics g = Graphics.FromHdc(hDc);
g.DrawString(SubtitleText, font1, Brushes.Black, pointF1);
ReleaseDC(hWnd, hDc);
}