Page 1 of 3

Print Windows Form

Posted: Fri Aug 30, 2013 10:49 am
by bpd2000
Working Example to Print Windows Form

Re: Print Windows Form

Posted: Fri Aug 30, 2013 11:20 am
by esgici
Thanks Dave :)

Successful 8-)

Happy HMG'ing

Re: Print Windows Form

Posted: Fri Aug 30, 2013 12:20 pm
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

Re: Print Windows Form

Posted: Fri Aug 30, 2013 3:59 pm
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 ) ]

Re: Print Windows Form

Posted: Fri Aug 30, 2013 4:16 pm
by bpd2000
Excellant
Thank you, Dr. Claudio

Modified Sample Print & Save

Re: Print Windows Form

Posted: Sat Aug 31, 2013 7:56 am
by esgici
bpd2000 wrote: Modified Sample Print & Save
Thank Dave :)

I'll inspect it ...

Regards

Re: Print Windows Form

Posted: Mon Sep 09, 2013 5:37 am
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.

Re: Print Windows Form

Posted: Fri Oct 14, 2016 4:14 pm
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

Re: Print Windows Form

Posted: Sat Oct 15, 2016 3:42 am
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.

Re: Print Windows Form

Posted: Sat Oct 15, 2016 9:27 am
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 8375 times
Source:
PrintFormSource.zip
(48.45 KiB) Downloaded 455 times
Executable:
PrintFormExe.zip
(1.51 MiB) Downloaded 469 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