Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
CatInaHat  
#1 Posted : Wednesday, May 11, 2005 2:40:00 AM(UTC)
CatInaHat

Rank: Member

Groups: Member
Joined: 5/11/2005(UTC)
Posts: 14

Hi,

Is there an example available of printing multiple images using GraphicsMill?

Thanks!

Alex Kon  
#2 Posted : Wednesday, May 11, 2005 12:55:00 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups:
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hello!

This is a simple code sample of printing several images on default printer. Every image will be placed in the center of separate page. For other placement variants see ImagePrintDocument.PlacementMode property.

Code:
string[] srcFilenames = new string[4];
srcFilenames[0] = "e:/pictures/Drawing/Cat.jpg";
srcFilenames[1] = "e:/pictures/Drawing/Meh_process1.jpg";
srcFilenames[2] = "e:/pictures/Drawing/Beachgirl.jpg";
srcFilenames[3] = "e:/pictures/Drawing/Anima - sadmann.jpg";
			
Bitmap[] srcImages = new Bitmap[srcFilenames.Length];
for (int i = 0; i < srcFilenames.Length; i++)
	srcImages[i] = new Bitmap(srcFilenames[i]);

ImagePrintDocument printDoc = new ImagePrintDocument();
printDoc.PlacementMode = PlacementMode.SingleImage;
printDoc.PrintOptions.ImageAutoRotate = true;
printDoc.PrintOptions.PlaceholderAutoRotate = true;
printDoc.Source = srcImages.GetEnumerator();
printDoc.Print();

I will post more advanced sample here in a few days.

Edited by user Sunday, December 23, 2007 6:11:50 PM(UTC)  | Reason: Not specified

CatInaHat  
#3 Posted : Wednesday, May 11, 2005 9:45:00 PM(UTC)
CatInaHat

Rank: Member

Groups: Member
Joined: 5/11/2005(UTC)
Posts: 14

Sorry for not being very specific, but is there a vb.Net example of this?

Or if possible, just a VB.Net version of the line:

srcImages[i] = new Bitmap(srcFilenames[i]);

Thanks again

Alex Kon  
#4 Posted : Thursday, May 12, 2005 1:25:00 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups:
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hello!

Yes, of course, with pleasure :)

Code:
'Specifying source filenames
Dim srcFilenames(3) As String
srcFilenames(0) = "e:/pictures/Drawing/Cat.jpg"
srcFilenames(1) = "e:/pictures/Drawing/Meh_process1.jpg"
srcFilenames(2) = "e:/pictures/Drawing/Beachgirl.jpg"
srcFilenames(3) = "e:/pictures/Drawing/Anima - sadmann.jpg"

'Loading images
Dim srcImages(srcFilenames.Length - 1) As Bitmap
Dim i As Integer
For i = 0 To srcFilenames.Length - 1
	srcImages(i) = New Bitmap(srcFilenames(i))
Next i

'Printing
Dim printDoc As New ImagePrintDocument
printDoc.PlacementMode = PlacementMode.SingleImage
printDoc.PrintOptions.ImageAutoRotate = True
printDoc.PrintOptions.PlaceholderAutoRotate = True
printDoc.Source = srcImages.GetEnumerator()
printDoc.Print()

Edited by user Sunday, December 23, 2007 6:12:06 PM(UTC)  | Reason: Not specified

CatInaHat  
#5 Posted : Thursday, May 12, 2005 6:49:00 PM(UTC)
CatInaHat

Rank: Member

Groups: Member
Joined: 5/11/2005(UTC)
Posts: 14

Perfect! Thanks! :D
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.