Printing the Screen From HMG

New members who wish to post and participate in HMG Forum, please introduce yourselves in this forum by starting a new thread.

Moderator: Rathinagiri

bluebird
Posts: 172
Joined: Wed Sep 28, 2016 3:55 am
DBs Used: DBF

Printing the Screen From HMG

Post 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
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Printing the Screen From HMG

Post by andyglezl »

Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Printing the Screen From HMG

Post 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...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Printing the Screen From HMG

Post by serge_girard »

Hi Bill,

Welcome from Belgium!


Serge
There's nothing you can do that can't be done...
bluebird
Posts: 172
Joined: Wed Sep 28, 2016 3:55 am
DBs Used: DBF

Re: Printing the Screen From HMG

Post 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
Attachments
Capture Sudoku.JPG
Capture Sudoku.JPG (257.92 KiB) Viewed 6730 times
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Printing the Screen From HMG

Post by bpd2000 »

BPD
Convert Dream into Reality through HMG
bluebird
Posts: 172
Joined: Wed Sep 28, 2016 3:55 am
DBs Used: DBF

Re: Printing the Screen From HMG

Post 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
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Printing the Screen From HMG

Post 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.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
bluebird
Posts: 172
Joined: Wed Sep 28, 2016 3:55 am
DBs Used: DBF

Re: Printing the Screen From HMG

Post 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
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Printing the Screen From HMG

Post 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
Viva INTERNATIONAL HMG :D
Post Reply