Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
I want to print normal text on half page and mirror text on the other half page on an A4 size paper. I have used printdocument object to print. Normal text is printing fine, but now i want to print mirror image of the same txt.
How can i do this in vb.net?
how can i print a mirror text using printdocument object in vb.net?
Posted 24-Feb-13 20:38pm
Edited 24-Feb-13 20:42pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Print your text on bitmap and them mirror this bitmap.
 
To write on bitmap, you can first create an instance of System.Drawing.Bitmap with required size and pixel format:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx[^].
 
To draw on it, you will need to create an instance of System.Drawing.Graphics from your instance of bitmap using this static factory method: http://msdn.microsoft.com/en-us/library/system.drawing.graphics.fromimage.aspx[^].
 
Now you can draw your text on bitmap using one of System.Drawing.Graphics.DrawString methods:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.aspx[^].
 
To make a mirror image, you will need to work a bit with image pixels. To do that, use one of LockBits methods:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.lockbits.aspx[^].
 
Finally, use PrintDocument to draw converted bitmap.
 
—SA
  Permalink  
Comments
mistryshailesh at 25-Feb-13 2:45am
   
Thanks for the answer.
But, I want to know the exact code, which shows how to write a mirror text . The soln that u gave me doesn't show me, how to use this methods to print a mirror text.
Sergey Alexandrovich Kryukov at 25-Feb-13 11:43am
   
No, you don't "want to know the exact code". The whole idea of "knowing the code" is wrong. You want to write the code, not having anyone to do your job. So, do it, ask questions if you stuck.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100