Rank: Member
Groups: Guest
Joined: 5/11/2005(UTC) Posts: 14
|
Hi, Is there an example available of printing multiple images using GraphicsMill?
Thanks!
|
|
|
|
Rank: Advanced Member
Groups: Guest
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 |
|
|
|
|
Rank: Member
Groups: Guest
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
|
|
|
|
Rank: Advanced Member
Groups: Guest
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 |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 5/11/2005(UTC) Posts: 14
|
|
|
|
|
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.