Page 1 of 1

Save all the Screen to BMP

Posted: Wed Oct 07, 2015 3:46 pm
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

Re: Save all the Screen to BMP

Posted: Wed Oct 07, 2015 4:11 pm
by Jeff Barnes
Try:

oWnd:SaveToBmp( cFile )

Re: Save all the Screen to BMP

Posted: Wed Oct 07, 2015 4:19 pm
by Romeo
It works !!!

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

More help f me ?

thanks any

Re: Save all the Screen to BMP

Posted: Wed Oct 07, 2015 4:22 pm
by Antonio Linares
Try this:

oWndFromHwnd( GetFocus() ):SaveToBmp( cFile )

Re: Save all the Screen to BMP

Posted: Wed Oct 07, 2015 4:32 pm
by Romeo
it works bad on windows and does not work for dialog

i have FWH 8.10

Re: Save all the Screen to BMP

Posted: Wed Oct 07, 2015 5:12 pm
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

Re: Save all the Screen to BMP

Posted: Thu Oct 08, 2015 8:39 am
by Antonio Linares
GetDesktopWindow() returns the handle for the entire screen

Re: Save all the Screen to BMP

Posted: Thu Oct 08, 2015 1:43 pm
by Romeo
Too simple to solve the problem !!!

Many thanks Antonio

R

Re: Save all the Screen to BMP

Posted: Fri Oct 09, 2015 11:00 am
by joseluispalma
Can you please share final code?.

Re: Save all the Screen to BMP

Posted: Tue Oct 13, 2015 9:16 am
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 ?

Re: Save all the Screen to BMP

Posted: Tue Oct 13, 2015 9:24 am
by Antonio Linares
Romeo,

You could try:

FIConvertImageFile( cDestinationFileName, cSourceFileName, nFormat, nQuality )

Re: Save all the Screen to BMP

Posted: Tue Oct 13, 2015 9:26 am
by Antonio Linares

Re: Save all the Screen to BMP

Posted: Tue Oct 20, 2015 10:11 am
by Romeo
thanks but the
FIConvertImageFile()
in missing in my FWH 8.10

:-(

Re: Save all the Screen to BMP

Posted: Tue Oct 20, 2015 1:48 pm
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