Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
QuestionDatagridView Column Re-ordering Pin
codeprasanna21-Apr-09 18:44
codeprasanna21-Apr-09 18:44 
AnswerRe: DatagridView Column Re-ordering Pin
Mycroft Holmes21-Apr-09 20:16
professionalMycroft Holmes21-Apr-09 20:16 
QuestionFtp Linux Command in .Net Pin
Abdul Rahman Hamidy21-Apr-09 18:02
Abdul Rahman Hamidy21-Apr-09 18:02 
AnswerRe: Ftp Linux Command in .Net Pin
blackjack215023-Apr-09 2:57
blackjack215023-Apr-09 2:57 
QuestionNeed assistance with automatic install application Pin
Robert Madsen21-Apr-09 17:13
professionalRobert Madsen21-Apr-09 17:13 
AnswerRe: Need assistance with automatic install application Pin
Perry Holman21-Apr-09 19:38
Perry Holman21-Apr-09 19:38 
GeneralRe: Need assistance with automatic install application Pin
Robert Madsen24-Apr-09 16:34
professionalRobert Madsen24-Apr-09 16:34 
AnswerRe: Need assistance with automatic install application Pin
Giorgi Dalakishvili21-Apr-09 19:40
mentorGiorgi Dalakishvili21-Apr-09 19:40 
GeneralRe: Need assistance with automatic install application Pin
Robert Madsen24-Apr-09 16:30
professionalRobert Madsen24-Apr-09 16:30 
QuestionHow to click on a website when it's minimized Pin
jeanbern21-Apr-09 17:08
jeanbern21-Apr-09 17:08 
QuestionRotate printing Pin
damichab21-Apr-09 16:31
damichab21-Apr-09 16:31 
AnswerRe: Rotate printing Pin
Luc Pattyn21-Apr-09 16:54
sitebuilderLuc Pattyn21-Apr-09 16:54 
GeneralRe: Rotate printing Pin
damichab21-Apr-09 17:12
damichab21-Apr-09 17:12 
GeneralRe: Rotate printing Pin
Luc Pattyn21-Apr-09 17:42
sitebuilderLuc Pattyn21-Apr-09 17:42 
GeneralRe: Rotate printing Pin
damichab21-Apr-09 17:50
damichab21-Apr-09 17:50 
GeneralRe: Rotate printing Pin
Luc Pattyn21-Apr-09 18:02
sitebuilderLuc Pattyn21-Apr-09 18:02 
GeneralRe: Rotate printing Pin
damichab21-Apr-09 19:15
damichab21-Apr-09 19:15 
GeneralRe: Rotate printing Pin
damichab21-Apr-09 19:18
damichab21-Apr-09 19:18 
GeneralRe: Rotate printing Pin
Luc Pattyn22-Apr-09 0:31
sitebuilderLuc Pattyn22-Apr-09 0:31 
GeneralRe: Rotate printing Pin
damichab22-Apr-09 1:23
damichab22-Apr-09 1:23 
GeneralRe: Rotate printing Pin
Luc Pattyn22-Apr-09 2:08
sitebuilderLuc Pattyn22-Apr-09 2:08 
David935 wrote:
Doing so makes the resulting image significantly smaller.


Probably because you didn't change your DrawLabel(), hence using only the topleft quarter of the larger bitmap.

Now stop mucking around, try the below code on your office printer and on your label printer, and describe exact symptoms if not satisfied.

protected void OnPrintPage(object sender, PrintPageEventArgs e) {
    float mmPerInch = 25.4f;
	// size in printer pixels
    int width = (int)(LabelSettings.Width * e.Graphics.DpiX / mmPerInch);
    int height = (int)(LabelSettings.Height * e.Graphics.DpiY / mmPerInch);
    Console.WriteLine("width="+width+"  heigth="+height);
    
    bitmap = new Bitmap(width, height);
    using (Artist = Graphics.FromImage(bitmap)) {
        DrawLabel(Artist, width, height);
    }

    e.Graphics.DrawImage(bitmap, 0, 0);
    bitmap.Dispose();
    e.HasMorePages = false;
}

Font font=new Font("Arial", 14);
Brush brush=new SolidBrush(Color.Black);

protected void DrawLabel(Graphics g, int width, int heigth) {
	g.DrawRectangle(Pen.Black, 1, 1, width-2, height-2);
	g.DrawString("Test font quality", font, brush, 3, 3);
}


Hmmm | :|

Luc Pattyn [Forum Guidelines] [My Articles]

Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in


GeneralRe: Rotate printing Pin
damichab22-Apr-09 4:18
damichab22-Apr-09 4:18 
GeneralRe: Rotate printing Pin
Luc Pattyn22-Apr-09 5:36
sitebuilderLuc Pattyn22-Apr-09 5:36 
GeneralRe: Rotate printing Pin
damichab22-Apr-09 21:01
damichab22-Apr-09 21:01 
GeneralRe: Rotate printing Pin
Luc Pattyn23-Apr-09 1:19
sitebuilderLuc Pattyn23-Apr-09 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.