Ja zrobiłem tak, żeby wyświetlac pełny obraz na drugim monitorze.
Może się przyda :)
//****************************************************
// Fullscreen on-off
//****************************************************
procedure TForm1.Image1DblClick(Sender: TObject);
var
hr:HRESULT;
MyHandle : cardinal;
Bounds: TRect;
DajNaDrugi : Boolean;
begin
DajNaDrugi := not monitor.Primary; //Program jest aktualnie na monitorze primary?
if DajNaDrugi then Bounds := Screen.monitors[1].BoundsRect //TV - rozmiary ekranu
else Bounds := Screen.monitors[0].BoundsRect; //monitor - rozmiary
//tworzę dynamicznie formę, na której bedzie wyswietlany obraz (pełny ekran)
IF FFullScreenForm = NIL THEN BEGIN
FFullScreenForm := TForm.CreateNew(nil);
with FFullScreenForm do
begin
BorderIcons := [];
BorderStyle := bsNone;
KeyPreview := True;
OnKeyDown := Self.OnKeyDown;
OnKeyPress := Self.OnKeyPress;
OnKeyUp := Self.OnKeyUp;
OnDblClick := Image1DblClick;
SetBounds(Bounds.Left, Bounds.Top, (Bounds.Right-Bounds.Left),(Bounds.Bottom-Bounds.Top));
end;
end;
ShowVideoWindow(not IsFullScreen);
end;
procedure TForm1.ShowVideoWindow(FullScreen: boolean);
begin
if not Assigned(FFullScreenForm) then
Exit;
application.ProcessMessages;
if FullScreen<>IsFullScreen then
begin
if FullScreen then
begin
DSSetVideoHandle(FFullScreenForm.Handle);
Self.Hide;
dsVideoWindow.SetWindowPosition(0, 0, FFullScreenForm.Width, FFullScreenForm.Height);
FFullScreenForm.Show;
end
else
begin
DSSetVideoHandle(pVideo.Handle);
FFullScreenForm.Hide;
dsVideoWindow.SetWindowPosition(0, 0, Form1.pVideo.Width, Form1.pVideo.Height);
Self.Show;
end;
IsFullScreen := FullScreen;
ShowCursor(not IsFullScreen);
end;
end;