Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

GDI+Desktop graphics and printing library

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-27-2008, 02:49 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default GDI+Desktop graphics and printing library

This major new desktop and .NET 2.0 only library is upwardly compatible with ImageLibEx and adds a load of additional graphics functionality that only exists on the desktop GDI+ graphics system. It also fully supports printing, including page setup and print preview, so that anything you can draw on an image can also be printed.

To a certain extent you are on your own using this library, I can document the functionality but I can't teach you how to use it. If you can use ImageLib or ImageLibEx you can easily get the same things printed and the additional graphics capabilities are pretty straightforward to use.. However to use some of the more advanced MeasureString and DrawString methods to format text will need some trial and error (probably lots of error!) and/or some research on the Web. To ease the problem of text formatting I have copied over the Rich Text Format printing support from my RichTextDesktop library, and improved it so that Rich Text can now be rendered on an image as well as being printed.

The output of the demo app included is a bit bit scrappy. As I have stated before I am not a "graphics" person and unlike some people I know who get a buzz out of writing graphics code I get bored doing it - my forte is the abstract stuff. Please therefore look past what the output looks like and examine what the library can do and how it does it.

It is probably as well to regard this first release as somewhat of a beta version as, due to the extent of the functionality of the thing, I have not been able (or willing!) to try many things in combination so I'm sure there will be some bugs and lots of errors in the help (I got really bored writing the help ).

EDIT :- Version1.1 posted with minor tweak to BitmapEx.Zoom memory management and BitmapEx.Zoom documented in the help.

EDIT : - Version 1.2 with some additional functions to match ImageLibEx improvements. See post #3 for details.

EDIT : - Version 1.3 allows some page settings to be changed for an individual page during the printing process. See post #8 for details.

EDIT : - Version 1.4 posted to match the changes in ImageLibEx 2.0. See post #10 for details.
Attached Files
File Type: zip GDI+Desktop1.4.zip (93.7 KB, 144 views)

Last edited by agraham : 01-21-2010 at 10:44 AM.
Reply With Quote
  #2 (permalink)  
Old 01-07-2009, 10:14 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Version 1.1 now posted with a very minor tweak to BitmapEx.Zoom memory management to dispose of an internal Bitmap object rather than rely upon the .NET garbage collector.

BitmapEx.Zoom is now documented in the help. It existed previously but I missed including it in the help.

Last edited by agraham : 01-07-2009 at 10:16 AM.
Reply With Quote
  #3 (permalink)  
Old 03-05-2009, 04:50 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Version 1.2 has the three improvements requested by Klaus for ImageLibEx.

FloodFill.Flood overwrites everything until a specified boundary color is found.

DrawerEX.DrawCircle draws a circle.

DrawerEX.FillCircle draws a filled circle.

Also added are DrawerEx.ARGB() and DrawerEx.GetARGB. These are similar to Basic4ppc RGB() and GetRGB() but include the alpha component of a desktop color.
Reply With Quote
  #4 (permalink)  
Old 01-05-2010, 10:41 AM
Basic4ppc Veteran
 
Join Date: Jul 2008
Location: Borchen, Germany
Posts: 434
Send a message via ICQ to corwin42
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hello Andrew,

I use your GDI+ Library to print some pages. I need to set the left and right margin individual for each page (left pages have another margin than right pages).

In the help file under the printer object section there is an Event QueryPageSettings explained.

Quote:
QueryPageSettings : Occurs immediately before each PrintPage event. It is possible to print each page of a document using different page settings. You set page settings by modifying individual properties of the QueryPageSettingsEventArgs.PageSettings property or by setting the property to a PageSettings. Changes made to the PageSettings affect only the current page, not the document's default page settings. The print job can also be canceled by setting the Cancel property to true for the QueryPageSettingsEventArgs.
I don't understand this completely. As I understand this, in this event call I should be able to set the margin for my page. I just tried to set printer.LeftMargin to another value but this does not work.

Can you explain it in more detail or do you have an example for this?

I think I have to use the door.library to obtain the QueryPageSettingsEventArgs.PageSettings property?

Thanks,
Markus
__________________
Markus
Reply With Quote
  #5 (permalink)  
Old 01-05-2010, 11:46 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Try this and post the results. There are 6 new properties

Cancel - stops printing when set in the event Sub for any of the events.

The following are page settings that may be read/written within the PrintPageEvent or QueryPageEvent. It is not clear from the .NET documentation whether modifying these settings has different effects in the two events or not.

PsLandscape
PsLeftMargin
PsRightMargin
PsTopMargin
PsBotttomMargin
Attached Files
File Type: zip GDI+Desktop1.21.zip (15.1 KB, 33 views)
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #6 (permalink)  
Old 01-05-2010, 12:02 PM
Basic4ppc Veteran
 
Join Date: Jul 2008
Location: Borchen, Germany
Posts: 434
Send a message via ICQ to corwin42
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Works perfectly.

If you change these properties in the QueryPageSettings event then you get the correct margin sizes in the PrintPage event with printer.Marginbounds.

Changing the properties in PrintPage doesn't seem to work.

Thanks very much.
__________________
Markus

Last edited by corwin42 : 01-05-2010 at 12:09 PM.
Reply With Quote
  #7 (permalink)  
Old 01-05-2010, 01:28 PM
Basic4ppc Veteran
 
Join Date: Jul 2008
Location: Borchen, Germany
Posts: 434
Send a message via ICQ to corwin42
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Andrew,

if you make a new release (with .cs file) of this version, I will share my little Application. I think its a good example of what can be done with Basic4PPC in really short time.

Thanks very much again for your extremely fast support.
__________________
Markus
Reply With Quote
  #8 (permalink)  
Old 01-05-2010, 01:57 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Version 1.3 posted with the changes referred to in post #5 above incoporated into the source and help files.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #9 (permalink)  
Old 01-05-2010, 02:39 PM
Basic4ppc Veteran
 
Join Date: Jul 2008
Location: Borchen, Germany
Posts: 434
Send a message via ICQ to corwin42
Awards Showcase
Beta Tester 
Total Awards: 1
Default Weekly Calendar example

Ok, here is a more complex example of what can be done with this library. This program was hacked together in just one day. I think this shows the power of Basic4PPC and its additional libraries.

Needs Version 1.3 or above of GDI+Desktop Library

The program just creates a weekly calendar (dates are configurable) that you can print out. Have fun with it.
Attached Files
File Type: sbp WeeklyCalendar.sbp (13.7 KB, 54 views)
__________________
Markus
Reply With Quote
  #10 (permalink)  
Old 01-21-2010, 10:47 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Version 1.4 was posted to incorporate the same functionality as ImageLibEx 2.0.

BitmapEx now has all the functionality of ImageLibEx.BitmapEx and an Icon class similar to ImageLibEx.Icon is added.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pretty printing library agraham Additional Libraries 68 07-14-2009 03:48 PM
printing capabilities Cableguy Basic4ppc Wishlist 15 03-18-2009 04:13 AM
printing and barcode printing help jchal Questions (Windows Mobile) 5 12-13-2008 06:52 AM
Desktop Help library agraham Additional Libraries 15 10-29-2008 04:33 PM
Graphics Library Nachtfalke Questions (Windows Mobile) 1 05-11-2007 01:50 PM


All times are GMT. The time now is 05:01 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0