FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Save all the Screen to BMP
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Save all the Screen to BMP
Posted: Wed Oct 07, 2015 03: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

Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Save all the Screen to BMP
Posted: Wed Oct 07, 2015 04:11 PM

Try:

oWnd:SaveToBmp( cFile )

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Save all the Screen to BMP
Posted: Wed Oct 07, 2015 04:19 PM

It works !!!

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

More help f me ?

thanks any

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Save all the Screen to BMP
Posted: Wed Oct 07, 2015 04:22 PM

Try this:

oWndFromHwnd( GetFocus() ):SaveToBmp( cFile )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Save all the Screen to BMP
Posted: Wed Oct 07, 2015 04:32 PM

it works bad on windows and does not work for dialog

i have FWH 8.10

Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Save all the Screen to BMP
Posted: Wed Oct 07, 2015 05: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Save all the Screen to BMP
Posted: Thu Oct 08, 2015 08:39 AM

GetDesktopWindow() returns the handle for the entire screen

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Save all the Screen to BMP
Posted: Thu Oct 08, 2015 01:43 PM

Too simple to solve the problem !!!

Many thanks Antonio

R

Posts: 109
Joined: Mon Apr 30, 2012 09:10 AM
Re: Save all the Screen to BMP
Posted: Fri Oct 09, 2015 11:00 AM

Can you please share final code?.

Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Save all the Screen to BMP
Posted: Tue Oct 13, 2015 09: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 ?
    
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Save all the Screen to BMP
Posted: Tue Oct 13, 2015 09:24 AM

Romeo,

You could try:

FIConvertImageFile( cDestinationFileName, cSourceFileName, nFormat, nQuality )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Save all the Screen to BMP
Posted: Tue Oct 13, 2015 09:26 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Save all the Screen to BMP
Posted: Tue Oct 20, 2015 10:11 AM

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

:-(

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Save all the Screen to BMP
Posted: Tue Oct 20, 2015 01: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

Continue the discussion