Save all the Screen to BMP

Post Reply
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Save all the Screen to BMP

Post by Romeo »

Hi,
I am using a TIMER to intercept a F8 key to try to create a BMP of all the video screen, but i'am not able !! :-(

This is my example:

define timer otime interval 50 action myfunc() of mainwnd

activate timer otime
.
.
.
function myfunc
if getasynckey(119)
* F8 pressed
HERE i need to write a BMP file with all the present screen
endif
return nil
*
ANY HELP ?

tks all
ROMEO/zingoni
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: Save all the Screen to BMP

Post by Jeff Barnes »

Try:

oWnd:SaveToBmp( cFile )
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Post by Romeo »

It works !!!

Now i need to know on with windows o dialog i'am pressing F8

More help f me ?

thanks any
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Save all the Screen to BMP

Post by Antonio Linares »

Try this:

oWndFromHwnd( GetFocus() ):SaveToBmp( cFile )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Post by Romeo »

it works bad on windows and does not work for dialog

i have FWH 8.10
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Post by Romeo »

I tried the GETACTIVEWINDOW() and it works, but it saves only the windows/dialog focused instead of all the screen.

I try to find other solution !

Hi
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Save all the Screen to BMP

Post by Antonio Linares »

GetDesktopWindow() returns the handle for the entire screen
regards, saludos

Antonio Linares
www.fivetechsoft.com
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Post by Romeo »

Too simple to solve the problem !!!

Many thanks Antonio

R
joseluispalma
Posts: 93
Joined: Mon Apr 30, 2012 9:10 am

Re: Save all the Screen to BMP

Post by joseluispalma »

Can you please share final code?.
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Post by Romeo »

function save_scr()
LOCAL hBmp, hDib,h,cFile := "screen.bmp"
h:=getdesktopwindow()
hBmp := WndBitmap(h)
hDib := DibFromBitmap( hBmp )
DibWrite( cFile, hDib )
GloBalFree( hDib )
DeleteObject( hBmp )
RETURN nil
*

* Now i'm tring to convert the BMP file to JPG file....any help ?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Save all the Screen to BMP

Post by Antonio Linares »

Romeo,

You could try:

FIConvertImageFile( cDestinationFileName, cSourceFileName, nFormat, nQuality )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Save all the Screen to BMP

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Post by Romeo »

thanks but the
FIConvertImageFile()
in missing in my FWH 8.10

:-(
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Save all the Screen to BMP

Post by Antonio Linares »

Romeo,

I can't help you with that as such function depends on some others that you may not have too.

I suggest you to upgrade your FWH from www.fivetechsoft.com, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply