Print Windows Form

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Print Windows Form

Post by bpd2000 »

Working Example to Print Windows Form
Attachments
PrintForm.rar
(19.56 KiB) Downloaded 747 times
BPD
Convert Dream into Reality through HMG
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Print Windows Form

Post by esgici »

Thanks Dave :)

Successful 8-)

Happy HMG'ing
Viva INTERNATIONAL HMG :D
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Print Windows Form

Post by bpd2000 »

esgici wrote:Thanks Dave :)

Successful 8-)

Happy HMG'ing
Thank you, Esgici
Attached example for Saving of Window / Form [unable to compile in HMG, it is compiled in Minigui]
Any one can do necessary correction to compile in HMG
Attachments
SaveForm.rar
(506.82 KiB) Downloaded 614 times
BPD
Convert Dream into Reality through HMG
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Print Windows Form

Post by srvet_claudio »

bpd2000 wrote:
esgici wrote:Thanks Dave :)

Successful 8-)

Happy HMG'ing
Thank you, Esgici
Attached example for Saving of Window / Form [unable to compile in HMG, it is compiled in Minigui]
Any one can do necessary correction to compile in HMG
Hi Dave.
See Capture Method of HMG.

Code: Select all

Capture a Window As a Bitmap File And Save It
 
Syntax:
 
<WindowName>.Capture [ ( cFileName , nRow , nCol , nWidth , nHeight ) ]
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Print Windows Form

Post by bpd2000 »

Excellant
Thank you, Dr. Claudio

Modified Sample Print & Save
Attachments
Print&SaveForm.rar
(26.34 KiB) Downloaded 630 times
BPD
Convert Dream into Reality through HMG
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Print Windows Form

Post by esgici »

bpd2000 wrote: Modified Sample Print & Save
Thank Dave :)

I'll inspect it ...

Regards
Viva INTERNATIONAL HMG :D
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Print Windows Form

Post by mol »

Nice work, thanks for sharing!

I don't know if it's good place to ask my question:

Is it the way to print bitmap created in memory without saving it to temporary file?

I need to generate labels for range of goods with barcodes.
bluebird
Posts: 172
Joined: Wed Sep 28, 2016 3:55 am
DBs Used: DBF

Re: Print Windows Form

Post by bluebird »

Friends of HMG

The Demonstration given to me in the archive printform.rar from a few sources looks like the answer to my printscreen need. However it always fails to compile with syntax errors at lines 65 67 77 79 149 151 153 155 and 157.

Has anyone else been successful?

Thanks
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Print Windows Form

Post by Rathinagiri »

mol wrote:Nice work, thanks for sharing!

I don't know if it's good place to ask my question:

Is it the way to print bitmap created in memory without saving it to temporary file?

I need to generate labels for range of goods with barcodes.
These are the new functions we have:

Code: Select all

New Functions:

OpenPrinterGetDC()             -->   hDC of the current Open Printer

OpenPrinterGetPageDC()         -->   hDC of the current Page being printed

And you can use the following BosTaurus function to draw a bitmap in memory to the PageDC as above.

Code: Select all

BT_DrawBitmap (hDC, Row, Col, Width, Height, Mode_Stretch, hBitmap)

Draws a bitmap in the Device Context (DC) specified.

hDC: is a handle to the device context.

Row, Col, Width, Height: specifies the size of the rectangle in pixels in the DC where you will draw the bitmap. For default: Row = 0, Col = 0, Width = BT_BitmapWidth(hBitmap), Height = BT_BitmapHeight(hBitmap).

Mode_Stretch: sets the mode as the bitmap is adjusts (is stretches or compresses) in the specified rectangle in the DC, it is one of the constants: BT_SCALE, BT_STRETCH or BT_COPY (defined in BosTaurus.CH).

hBitmap: is a handle to the bitmap.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Print Windows Form

Post by esgici »

bluebird wrote:Friends of HMG

The Demonstration given to me in the archive printform.rar from a few sources looks like the answer to my printscreen need. However it always fails to compile with syntax errors at lines 65 67 77 79 149 151 153 155 and 157.

Has anyone else been successful?

Thanks
Hi Bill

Please don't worry, here you are between friends :arrow:

Probably this is week end and orijinal author of program (our Dear Friend Dave) not have enough spear time.

Here slightly modified to working version of orijinal program:

Result:
PF_Result.JPG
PF_Result.JPG (41.48 KiB) Viewed 8364 times
Source:
PrintFormSource.zip
(48.45 KiB) Downloaded 455 times
Executable:
PrintFormExe.zip
(1.51 MiB) Downloaded 468 times
Please note that:

- There is more points to optimize in this program
- This program is quite old and include some obsolete methods and functions
- Now we have more practical and short facilities ( Bostaurus library: BT_* functions )

So it's possible more and more adequate and short ways to achieve print / save images.

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
Post Reply