Recent

Author Topic: How display form "fullscreen", (linux,windows) to hide everything including men  (Read 14843 times)

seba22

  • Full Member
  • ***
  • Posts: 136
Welcome,

I'm working on screen capture tool.

My progress stops at point showing to user image what he would like to "crop".


My idea was to create a form without border (none) and make width and height, same as grabbed screenshot.
Code: [Select]
MyBitmap := TBitmap.Create;
  ScreenDC := GetDC(0);
  MyBitmap.LoadFromDevice(ScreenDC);
  ReleaseDC(0,ScreenDC);   
  form1.width:=MyBitmap.width;
  form1.height:=MyBitmap.height;

Border syle -> bsNone

Compile great, and  almost WORK...

In Gnome, form is created under top menu.

So, top and bottom menu are over my form...

Any other way, to make it"full screen" ?

I mean, force my form over any possible menu, system, time, task ect ?

Regards
     

typo

  • Hero Member
  • *****
  • Posts: 3051
Code: [Select]
Width := Screen.Width;
Height := Screen.Height;

seba22

  • Full Member
  • ***
  • Posts: 136
No my friend, that's not the problem.

Please look at the screenshot.

There is two menu.
First on top is system, second is my image (form).
Hmm

I was really thinking that bsnone, will allow me to do this ;(

typo

  • Hero Member
  • *****
  • Posts: 3051
Code: [Select]
  BorderStyle := bsNone;
  Left := 0;
  Top := 0;
  Width := Screen.Width;
  Height := Screen.Height;

seba22

  • Full Member
  • ***
  • Posts: 136
This same ;-(

Whiterawen

  • New Member
  • *
  • Posts: 12
    • Lirein's Homepage
gdk_window_fullscreen(PGtkWidget(Handle)^.window);
 - to switch form to full screen dimensions
gdk_window_unfullscreen(PGtkWidget(Handle)^.window);
 - to roll back to normal mode

P.S. GTK2 only. You must add to uses section such modules as gtk2, gdk2, glib2. You can do it by the directive {$IFDEF LCLGTK2}, gtk2, gdk2, glib2{$ENDIF}.
WBR, Vanya Batalin.

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
I have a capture tool i made,it's working great in Gnome (Ubuntu 10.03) and i used
Screen.Width and Screen.Height as typo said.
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

seba22

  • Full Member
  • ***
  • Posts: 136
gdk_window_fullscreen(PGtkWidget(Handle)^.window);
 - to switch form to full screen dimensions
gdk_window_unfullscreen(PGtkWidget(Handle)^.window);
 - to roll back to normal mode

P.S. GTK2 only. You must add to uses section such modules as gtk2, gdk2, glib2. You can do it by the directive {$IFDEF LCLGTK2}, gtk2, gdk2, glib2{$ENDIF}.


Working perfect ;)
Thank You, i will never found it alone...

mas steindorff

  • Hero Member
  • *****
  • Posts: 562
Welcome,
I'm working on screen capture tool.
...
Code: [Select]
MyBitmap := TBitmap.Create;
  ScreenDC := GetDC(0);
  MyBitmap.LoadFromDevice(ScreenDC);
  ReleaseDC(0,ScreenDC);   
  form1.width:=MyBitmap.width;
  form1.height:=MyBitmap.height;
   
Can you capture a 2nd or 3rd screen? GetDC(0) grabs only the 1st screen for me.
windows 10 &11, Ubuntu 21+ IDE 3.4 general releases

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
ScreenDC := GetDC(1);
  MyBitmap.LoadFromDevice(ScreenDC);
  ReleaseDC(1,ScreenDC);

maybe this code will capture your 2nd screen and increase it to capture other screens.

0 will still be the primary screen i guess
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2673
GetDC(1) wont work. Only a 0 handle is handled special
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018