I've embedded MPlayer video results into TPanel
successfully, BUT can't copy TPanel
results into a TImage
.
ONLY the normal picture of TPanel
is copied into TImage
:
Embedding is performed using piping and MPlayer wid command line parameters. MPlayer using TPanel
handle to display results.
The following snippets tested, but just normal TPanel
picture copied into TImage
:
Image1.Picture.Bitmap.Canvas.CopyRect(
Rect(0, 0, Image1.Width-1, Image1.Height-1),
TMyPanel(Panel1).Canvas, //TMyPanel is an empty class to access canvas property
Rect(0, 0, Panel1.Width-1, Panel1.Height-1)
);
and this:
Function PanelToBmp ( Panel:TPanel):TBitmap;
VAR
bmp : tBitmap;
DC : HDC;
Begin
bmp := tBitmap.Create;
bmp.width := Panel.Width;
bmp.Height := Panel.Height;
DC := GetDc ( Panel.Handle );
Bitblt(bmp.canvas.handle, 0, 0, Panel.Width, Panel.Height, Dc, 0, 0, NOTSRCCOPY);
Releasedc (Panel.handle,dc);
result := bmp;
End;