Page 1 of 2

Printing the Screen From HMG

Posted: Tue Oct 11, 2016 4:40 pm
by bluebird
Hello Friends

My Name is Bill. I need help in adding a "Print the Screen" function to my project.

My first project is to design a Sudoku helper that allows entry to input the given puzzle numbers, then scans to find all remaining possibilities for the blank squares. It fills the blanks for you and displays results. This now works well, but I would like to avoid using Windows Snipping Tool to save and print the result.

There is an old thread that says HB has a PRINTWINDOW function and gives an example. However that example will not compile. The compiler cannot find such a function and gives numerous syntax errors.

Do any members have a successful solution to printing screen image?

Thanks

Re: Printing the Screen From HMG

Posted: Tue Oct 11, 2016 5:31 pm
by andyglezl

Printing the Screen From HMG

Posted: Tue Oct 11, 2016 5:32 pm
by Pablo César
Hi Bill, welcome to our community. :)

This printscreen you have mentioned is it a clipboard copy image ?
This will be save as file ? Or be only displayed and add some text in the images?

To capture image, there is a important graphic function BossTaurus:

BT_BitmapCaptureDesktop
BT_BitmapCaptureWindow
BT_BitmapCaptureClientArea

BT_BitmapClipboardPut
BT_DrawText

These syntax you can find in "Bos Taurus"/ Reference Guide at C:\hmg.3.4.3\DOC HMGDOC

I can not help without screen or any code in your try...

Re: Printing the Screen From HMG

Posted: Wed Oct 12, 2016 8:48 am
by serge_girard
Hi Bill,

Welcome from Belgium!


Serge

Re: Printing the Screen From HMG

Posted: Fri Oct 14, 2016 12:53 am
by bluebird
Here is the picture of the screen I want to capture. You can see the Print Button ready to go if I can find out how to print it to my default printer.[img

Re: Printing the Screen From HMG

Posted: Fri Oct 14, 2016 4:22 am
by bpd2000

Re: Printing the Screen From HMG

Posted: Fri Oct 21, 2016 10:05 pm
by bluebird
Tring to use BosTaurus functions

Does any kind person out there know of a compilable working use of for example BT_BitmapCaptureWindow(form_1,0,0,1040,940).
I have tried using it to get closer to the goal of saving and printing a window image.

It does not work past the linker which decalares it an unrecognized external.

Thanks for reading

Printing the Screen From HMG

Posted: Fri Oct 21, 2016 10:43 pm
by Pablo César
Hi Bill,
bluebird wrote:Does any kind person out there know of a compilable working use of for example BT_BitmapCaptureWindow(form_1,0,0,1040,940)
You are right. There is not any sample about BT_BitmapCaptureWindow and print (simultaneously, but samples in separated). But you can be the first. :)

You have forgotten to put form_1 in quotes. Otherrwise any system will interprete as a variable.

Have you read HMGDOC at Bos Taurus item ?

You will see BT_BitmapCaptureWindow return a handle(1). After taking this handle thru a variable you can atttrib to IMAGE control (2) then you can print (3) in graphical mode of course. This is the right sequence. The better thing is to learn by our difficulties than get easily the fish...

1)hBitmap:=BT_BitmapCaptureWindow("form_1",0,0,1040,940) // will get image handle
(See BossTaurus examples: see demo5, demo6 and demo11)

2)Here you have to option: to save to a file (easier way) or use direct from the memory

See this topic (see point #3 of Claudio´s message):
viewtopic.php?p=45801#p45801

3) Read this topic (see Pict2Prn function at code of Claudio´s msg):
viewtopic.php?p=30633#p3063

If you have success with my explaination, please be kind to post your code test for printing screen.

Sorry I can not help more in exemples, because I am without my PC. And I have not any example in this tablet.

Re: Printing the Screen From HMG

Posted: Sat Oct 22, 2016 3:56 am
by bluebird
Thanks about the quotes. However I still get a link error
UNRESOLVED EXTERNAL _HB_FUN_BT_BitmapCaptureWindow

Where is the linker supposed to finf it?

Thanks

Re: Printing the Screen From HMG

Posted: Sat Oct 22, 2016 8:25 am
by esgici
bluebird wrote:Tring to use BosTaurus functions

Does any kind person out there know of a compilable working use of for example BT_BitmapCaptureWindow(form_1,0,0,1040,940).
I have tried using it to get closer to the goal of saving and printing a window image.

It does not work past the linker which decalares it an unrecognized external.

Thanks for reading
http://hmgforum.com/viewtopic.php?f=9&t=4902