April 19, 2024, 08:38:52 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Print from Clipboard

Started by Brian, June 24, 2020, 07:41:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

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

LarryMc

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.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

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