Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Program Announcements / Zappo Printing Plugin (DBPro)

Author
Message
Zappo
Valued Member
18
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 23rd May 2007 00:40 Edited at: 3rd Jun 2007 01:05
Another DarkBasic Pro plugin I wrote today for printing (to a printer). Its as simple as it can possibly be to use. It is currently still a Beta version but fully functional and FREE. I have tested it with monochrome laser printers, colour inkjets and PDF creators with complete success!

There are only two functions, the first being:
Zappo PrintDialog()
This will call up the Windows Printer Dialog box to allow users to choose which printer they want to use (if they have more than one installed) and the usual things like papersize, print quality etc. It returns TRUE if the user clicks on the 'okay' button or FALSE if they click on the 'cancel' button. The result is not used by the plugin but is there in case you want it. This function is optional and does not need to be called if you just want to print to the default printer with its current settings.

The second function does the actual printing:
Zappo PrintOut(filename, orientation, scale)
It will only print a bitmap for now so its up to you to decide what you will print. A good example would be to capture the screen and save it as a bitmap. If there is enough call I may add support for Jpegs etc later. The first parameter is the filename of the bitmap image, e.g. "picture.bmp". The second parameter is for paper orientation. Setting it as 0 will use the current printers setting (which can be set by the user from the print dialog). Setting it to 1 will print portrait, or 2 will print landscape. The third parameter is for scaling. Setting it to 0 will result in no scaling and will print at the printers resolution. Setting it to 1 will scale the image to fill the page but keeping the images aspect ratio (so it won't be distorted).

An example of its complete use could be:


More info including installation instructions and usage restrictions is in the readme file.

Download from here: ZappoPrint.zip

Please let me know if you have any problems with it. It is still a beta plugin so I would be interested to know if it works okay under Vista or even DarkSDK if anyone wants to try it out. Enjoy!

UPDATE v0.0.2 - See post below.
Zappo
Valued Member
18
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 23rd May 2007 17:47
Thought I would knock up a demo application just to show you how this plugin works and how easy it is to use.

Possibly the Worlds Simplest Drawing Package!

A compiled version along with the source and project files should be attached to this post. Here is the source which should be run in a 640x480 window (unless you fiddle with it):


The left mouse button draws with a red pen, the right mouse button draws with a multicoloured pen. Press the 'p' key to print. You will see the dialog box first and can click cancel if you decide you don't want to print. Clicking 'okay' will send the picture to the printer. Simple, eh? A drawing and printing program in 20 lines.

Attachments

Login to view attachments
Zappo
Valued Member
18
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 3rd Jun 2007 01:09
UPDATE v0.0.2

I have now added two more commands to this DLL.

Zappo PageWidth()
Zappo PageHeight()


These commands will return the maximum width and height of the current printing page in dots/pixels. This will depend upon the paper size and printing resolution of your printer. It means you can now create a bitmap the full size of the page so printing will be the best possible quality.

I am a little disappointed that nobody has posted a reply to this thread. I thought lots of people were begging for a printing plugin, or did I miss one someone else has released? Oh well, any comments or ideas for improvement are welcome.
Olby
19
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 3rd Jun 2007 23:06
Looks interesting but it would be even better if it could directly print out text documents. I believe there are small amount of people who will print images from DBPro. I better off using MS Paint for image printing!

AMD Sempron 1.8+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP Pro SP2, DirectX 9.0c (Feb2007), DBPro 6.6b
http://www.myspace.com/producerolby
Zappo
Valued Member
18
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 4th Jun 2007 01:05
Really its for people who want to make their own paint packages (better than MS Paint), photo album managers, desktop publishers, word processors, greetings card creators, etc. etc.
Just printing text is not as simple as most people think as you need to consider what font to use, the size of the font, wordwrapping, paper orientation etc. You can use this plugin to print text by simply creating a bitmap and sticking your text on it using the 'print' or 'text' commands. You can look after the wordwrapping yourself then and even add headers and footers if you wish and different sized text. Totally up to you and under your control. With the 'scale' option you can even be sure it will appear exactly the same on all printers.
Thanks for commenting though.
Ric
18
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Jun 2007 02:40 Edited at: 4th Jun 2007 02:45
Zappo - this looks like a great utility. I can't believe I just spotted this - and I'm amazed at the lack of responses to this thread. People have been crying out for a utility that allows printing of bitmaps from DBPro for ages, so this really is ground-breaking.

If you could get it to print some other formats too that would be pretty cool, although I guess anything you can have on the screen can be converted to a bitmap anyway, so it doesn't seem too big a deal.

Good work.

Zappo
Valued Member
18
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 4th Jun 2007 02:57 Edited at: 4th Jun 2007 17:12
Thanks Ric.
I could add Jpeg support but then you start to lose quality with artifacting. I can see why you might want to send Jpeg photos straight to the printer from a photo album application so I might add that feature later.
Sixty Squares
16
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 7th Jun 2007 03:06
Wow I just noticed this too! It looks really cool I'm looking forward to testing it out when I need it

mysticone
15
Years of Service
User Offline
Joined: 4th Sep 2007
Location:
Posted: 18th Sep 2007 03:46
Zappo, do you have any printing codes that would print from DB Pro to the printer like "in the olden days of GW Basic" - example: lprint chr$(32) and the charactor $ would print from the printer and maybe in color too (see attachment)

Attachments

Login to view attachments

Login to post a reply

Server time is: 2022-11-29 08:42:56
Your offset time is: 2022-11-29 08:42:56