IonicWind Software

IWBasic => General Questions => Topic started by: Brian on June 24, 2020, 07:41:49 AM

Title: Print from Clipboard
Post by: Brian on June 24, 2020, 07:41:49 AM
I have a bitmap image in the Clipboard. Is it possible to print it directly from there?

I can open XnView and have it automatically import the bitmap, but not everyone has XnView!

Any ideas!

Brian
Title: Re: Print from Clipboard
Post by: LarryMc on June 24, 2020, 02:55:20 PM
The only thing I can think of is to create a hidden window ,say with and origin at -5000,-5000 and copy the image from the clipboard to the window and then print the window. 

Or put a control on that window and copy the image to that control and then print it from that control.
Title: Re: Print from Clipboard
Post by: Brian on June 30, 2020, 01:02:53 PM
I asked the other day whether it was possible to print a bitmap from the Clipboard - and it is!

As part of one of Bill H's programs, and a load of help from Fasecero (thank you, Gabriel), the following code captures the program window and places it onto the Clipboard as a bitmap, and then shows a Print Dialog for you to print it. I would choose a PDF printer to test, because it saves on paper and ink

I have posted the full code for both vertical and horizontal prints

Maybe the scaling could be worked on, as it uses StretchBlt, so the printed image is larger than the original. Anyone?

Options:

Exit - closes the program
PrintWindow - uses IWB's native PRINTWINDOW command
Clip Horizontal - captures the window and prints it horizontally
Clip Vertical - captures the window and prints it vertically
Use XnView - captures the window and imports the bitmap into XnView

The reason I am using GETCLIENTSIZE is that you get a "clean" capture, with no titlebar and frames

Hope it helps someone!

Brian