Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Printing a bitmap in Win32

This thread is locked; no one can reply to it. rss feed Print
Printing a bitmap in Win32
Raf256
Member #3,501
May 2003

HI,
I want to print an BITMAP* on default system printer in WinXP + DevCPP/MinGW/GCC and ofcourse Allegro.
How can I do it?
Perhaps using geting printer Canvans and drawing onto them method.
I had some small example program but it had unresolved references while linking... perhaps a complete C/C++ source + what libraties/options use (and where to get them from)?

How can I use shellexecute to alternatively print a document by saving it into a .bmp first?

Is it possible to get metrics of printer page / etc - to have image fit-to-screen? How to get/set the DPI of image (and set paper type to A4 page)?

Thanks in advice! (Btw I need answer quickly, so I would be greatefull even for any clue).

23yrold3yrold
Member #1,134
March 2001
avatar

You could convert the BITMAP* to an HBITMAP using the Allegro function. I assume printing an HBITMAP is fairly simple, though I haven't had occasion to try it ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

ReyBrujo
Moderator
January 2001
avatar

No, it is rather tediously. You need to setup a lot of things. Even with MFC is a pain in the a**. I suggest you to save the bitmap on hard disk, and let the user print it later.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

A J
Member #3,025
December 2002
avatar

if only that "Print Screen" button did what it was supposed to.
and can anyone tell my what a Scroll Lock key does ?
or why we still have a caps lock key so large ?

___________________________
The more you talk, the more AJ is right. - ML

Nick Fisk
Member #2,197
April 2002
avatar

Surely couldn't you just save the screen as a bitmap and then call the system command to print a bitmap.

Eg in windows:-
"C:\WINNT\system32\mspaint.exe" /p "%1"

gnolam
Member #2,030
March 2002
avatar

A J said:

and can anyone tell my what a Scroll Lock key does ?
or why we still have a caps lock key so large ?

I assume you're just trolling as usual, but anyway...
Scroll Lock - surprise - locks scrolling. Very handy for console work where you only have a screen's worth of buffer.
The caps lock key is big because you want to keep a straight outer line with the keys and at the same time indent the second alphabetic key row.

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Raf256
Member #3,501
May 2003

My application is used to encode encrypted images after giving a password, and allows to view image. It also should print the image.

I know that there are many ways to steal image anyway - printscreen for example, or scanning printed image ;) but I want to make it as hard as possible, so saving a .bmp to disc and running paint on it is a bad idea...

Go to: