Print Windows Form

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
bpd2000
Posts: 948
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 118 times
Been thanked: 42 times

Print Windows Form

Post by bpd2000 » Fri Aug 30, 2013 10:49 am

Working Example to Print Windows Form
Attachments
PrintForm.rar
(19.56 KiB) Downloaded 304 times
BPD
Convert Dream into Reality through HMG

User avatar
esgici
Posts: 4337
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 221 times
Been thanked: 77 times
Contact:

Post by esgici » Fri Aug 30, 2013 11:20 am

Thanks Dave :)

Successful 8-)

Happy HMG'ing
Viva INTERNATIONAL HMG :D

User avatar
bpd2000
Posts: 948
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 118 times
Been thanked: 42 times

Post by bpd2000 » Fri Aug 30, 2013 12:20 pm

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 266 times
BPD
Convert Dream into Reality through HMG

User avatar
srvet_claudio
Posts: 1948
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 30 times
Been thanked: 118 times
Contact:

Post by srvet_claudio » Fri Aug 30, 2013 3:59 pm

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: 948
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 118 times
Been thanked: 42 times

Post by bpd2000 » Fri Aug 30, 2013 4:16 pm

Excellant
Thank you, Dr. Claudio

Modified Sample Print & Save
Attachments
Print&SaveForm.rar
(26.34 KiB) Downloaded 265 times
BPD
Convert Dream into Reality through HMG

User avatar
esgici
Posts: 4337
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 221 times
Been thanked: 77 times
Contact:

Post by esgici » Sat Aug 31, 2013 7:56 am

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

I'll inspect it ...

Regards
Viva INTERNATIONAL HMG :D

User avatar
mol
Posts: 2841
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 118 times
Been thanked: 64 times
Contact:

Post by mol » Mon Sep 09, 2013 5:37 am

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: 99
Joined: Wed Sep 28, 2016 3:55 am
Has thanked: 21 times
Been thanked: 5 times

Post by bluebird » Fri Oct 14, 2016 4:14 pm

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: 5162
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 128 times
Been thanked: 130 times
Contact:

Post by Rathinagiri » Sat Oct 15, 2016 3:42 am

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: 4337
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 221 times
Been thanked: 77 times
Contact:

Post by esgici » Sat Oct 15, 2016 9:27 am

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 1044 times
Source:
PrintFormSource.zip
(48.45 KiB) Downloaded 91 times
Executable:
PrintFormExe.zip
(1.51 MiB) Downloaded 92 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