Save all the Screen to BMP

Save all the Screen to BMP

Postby Romeo » Wed Oct 07, 2015 3:46 pm

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
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Postby Jeff Barnes » Wed Oct 07, 2015 4:11 pm

Try:

oWnd:SaveToBmp( cFile )
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Save all the Screen to BMP

Postby Romeo » Wed Oct 07, 2015 4:19 pm

It works !!!

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

More help f me ?

thanks any
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Postby Antonio Linares » Wed Oct 07, 2015 4:22 pm

Try this:

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

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

Re: Save all the Screen to BMP

Postby Romeo » Wed Oct 07, 2015 4:32 pm

it works bad on windows and does not work for dialog

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

Re: Save all the Screen to BMP

Postby Romeo » Wed Oct 07, 2015 5:12 pm

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
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Postby Antonio Linares » Thu Oct 08, 2015 8:39 am

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

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

Re: Save all the Screen to BMP

Postby Romeo » Thu Oct 08, 2015 1:43 pm

Too simple to solve the problem !!!

Many thanks Antonio

R
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Postby joseluispalma » Fri Oct 09, 2015 11:00 am

Can you please share final code?.
joseluispalma
 
Posts: 109
Joined: Mon Apr 30, 2012 9:10 am

Re: Save all the Screen to BMP

Postby Romeo » Tue Oct 13, 2015 9:16 am

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 ?

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

Re: Save all the Screen to BMP

Postby Antonio Linares » Tue Oct 13, 2015 9:24 am

Romeo,

You could try:

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

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

Re: Save all the Screen to BMP

Postby Antonio Linares » Tue Oct 13, 2015 9:26 am

regards, saludos

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

Re: Save all the Screen to BMP

Postby Romeo » Tue Oct 20, 2015 10:11 am

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

:-(
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Save all the Screen to BMP

Postby Antonio Linares » Tue Oct 20, 2015 1:48 pm

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42117
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 94 guests

cron