アプリ版:「スタンプのみでお礼する」機能のリリースについて

C# 2010 印刷余白は何処を基準としているのですか?
印刷可能範囲に赤の四角形を書き、その内側10ミリに青の四角形を書くために pageSetupDialog を表示して左右上下の10を指定しました
印刷結果は画像の通りで、左と上は概ね10ミリになりましたが右は1ミリの余白、下は更に狭くなってしまいます
何故でしょうか? 余白とは印刷可能範囲の内側を示す値ではないのですか?
private void button1_Click(object sender, EventArgs e)
{
this.pageSetupDialog1.Document = this.printDocument1;
pageSetupDialog1.PrinterSettings=new System.Drawing.Printing.PrinterSettings();
pageSetupDialog1.ShowNetwork = false;
DialogResult result = pageSetupDialog1.ShowDialog();
this.printDocument1.Print();
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawRectangle(new Pen(Color.Red, 10), e.Graphics.VisibleClipBounds.Left, e.Graphics.VisibleClipBounds.Top, e.Graphics.VisibleClipBounds.Width, e.Graphics.VisibleClipBounds.Height); //赤 印刷可能内サイズ 
e.Graphics.DrawRectangle(new Pen(Color.Blue, 10), e.MarginBounds.Left, e.MarginBounds.Top, e.MarginBounds.Width, e.MarginBounds.Height); //青 余白内サイズ
}

****************************************************************
MSN質問箱のご担当者さまへ
先ほど添付データを忘れて同じ質問を投稿してしまいました
今回は添付しましたので、以前のものを削除してください

「C# 2010 印刷余白は何処を基準とし」の質問画像

A 回答 (1件)

マージンは用紙の端が基準のはずです ・・・



印刷可能範囲の取得は e.Graphics。VisibleClipBoudsでは無いように思います

e.PageSettings.PrintableArea では無いでしょうか …

参考
添付画像の赤:マージン、緑:VisibleClipBouds、青:PrintableArea です
「C# 2010 印刷余白は何処を基準とし」の回答画像1
    • good
    • 0
この回答へのお礼

ありがとうございました
お陰で助かりました
今後とも宜しくお願い申上げます

お礼日時:2010/10/07 10:10

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!