- ベストアンサー
C#印刷可能領域と余白範囲の関係
- C#で印刷可能な領域と余白範囲の関係について調査しました。
- プリンタで印刷可能な最大画像を出力するため、余白範囲を印刷可能範囲まで拡大しました。
- しかし、余白範囲は読み取り専用のようで、変更しても値は変わりませんでした。何のために余白範囲があるのか疑問に思っています。
- みんなの回答 (1)
- 専門家の回答
質問者が選んだベストアンサー
関連するQ&A
- C# 2010 印刷余白は何処を基準としているのですか?
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・C++・C#
- C# 2010 で1インチの印刷余白を指定しiたい
C# 2010 で1インチの印刷余白を指定しiたい 私のプリンタはどこにでもある96DPIです だから上下左右のデフォルトの余白に96を指定しました そして pageSetupDialog を表示しますと、上下左右の余白表示は 24.38 となっていました 1インチは 25.4ミリです なぜでしょうか? 教えてください private void button1_Click(object sender, EventArgs e) { this.pageSetupDialog1.EnableMetric = true; printDocument1.DefaultPageSettings.Margins.Left = 96; printDocument1.DefaultPageSettings.Margins.Right = 96; printDocument1.DefaultPageSettings.Margins.Top = 96; printDocument1.DefaultPageSettings.Margins.Bottom = 96; this.pageSetupDialog1.Document = this.printDocument1; pageSetupDialog1.PrinterSettings = new System.Drawing.Printing.PrinterSettings(); pageSetupDialog1.ShowNetwork = false; DialogResult result = pageSetupDialog1.ShowDialog(); this.printDocument1.Print(); }
- ベストアンサー
- C・C++・C#
- 小窓に余白が・・・
<script language="JavaScript"><!-- var pop; function newwindow(URL,WIDTH,HEIGHT,LEFT,TOP){ pop = window.open(URL,"PopWindow","directories=0,location=0, menubar=0,toolbar=0,status=0,resizable=0, scrollbars=0"+",width="+WIDTH+",height="+HEIGHT+", left="+LEFT+",top="+TOP); pop.focus();pop.moveTo(LEFT,TOP);pop.resizeTo(WIDTH,HEIGHT); } function closenewwin(){ if (pop){ pop.close(); } } // --></script> jpg画像を設定しておりますが、小窓に余白ができてしまいます。 画像ぴったりに納めたいのですが、小窓のサイズを変えても 余白ができてしまいます。 どのようにすれば余白はなくなりますか?
- ベストアンサー
- JavaScript
- ネットスケープで上に余白があいてしまいます
お忙しいところすみません。どうしたら良いのか分からないので、教えていただけると大変うれしいです。 IEだと上の余白がなくちゃんと表示されるのですが、ネスケで見ると上にかなりの余白があいています。マージンを2パターンで指定しているのですが、なぜなのでしょうか? body { margin-left: 0px; margin-top: 0px; margin-height: 0px; margin-right: 0px; margin-bottom: 0px; } 何かタグが足りないのでしょうか? どうぞよろしくお願いします。
- ベストアンサー
- HTML
- なぜか余白が…
スタイルシートでmarginを0pxに設定し、テーブルを幅100%、縦100%に設定したあとでjavascriptを設定すると、どうしても上部に余白が出来てしまいます。 javascriptを設定しないときは <HTML> <HEAD> <TITLE></TITLE> <STYLE type="text/css"> <!-- BODY{ margin-top : 0px; margin-left : 0px; margin-right : 0px; margin-bottom : 0px; } --> </STYLE> </HEAD> <BODY bgcolor="#ffffff"> <TABLE border="1" width="100%" height="100%" bgcolor="#000000"> <TBODY><TR><TD></TD></TR></TBODY></TABLE> </BODY> </HTML> と正常なんですが、javascriptを設定すると、 <HTML> <HEAD> <TITLE></TITLE> <STYLE type="text/css"> <!-- BODY{ margin-top : 0px; margin-left : 0px; margin-right : 0px; margin-bottom : 0px; } --> </STYLE> <SCRIPT Language="JavaScript"> <!-- document.write("<img src=cgi-bin/sasuke.cgi?sasuke="); document.write(document.referrer+"' width=1 height=1>");// --> </SCRIPT> </HEAD> <BODY bgcolor="#ffffff"> <TABLE border="1" width="100%" height="100%" bgcolor="#000000"> <TBODY><TR> <TD></TD> </TR> </TBODY></TABLE> </BODY> </HTML> のようにどうしても上部に余白が出来てしまいます。 このスクリプトを設定したときのみ、こうなるので非常に困っています。(HPのデザイン上…) どなたか、よい方法がありましたら教えてください。m(__)m なお、スクリプトはアクセス解析です。 当方はwindows98 ie5.5の環境で作成しています。 javascriptはこの場合はhtml内に組み込んでいますが、××.jsで呼び出しをかけています。 よろしくお願いします!
- ベストアンサー
- HTML
- IE6で画像の下に余白が入ってしまいます。
CSSを使ってレイアウトをしているのですが、 <ul> <li>画像</li> <li>画像</li> <li>画像</li> </ul> でなぜか画像ごとに、下の部分に少しだけ余白ができてしまいます。 CSSでmarginやpaddingを0にしたり、 http://www.happy-crossing.com/tagmemo/log/eid11.html にあるようにvertical-align:bottomにしたり・・・ それでもなぜか下の余白が表示されています。 こちらの方は治ったみたいなのですが・・・ 他のブラウザはいろいろ見ましたが、余白などなく表示されていました。 Dreamweaver上でも少し余白が見えています・・・ お心当たりのある方がいらっしゃいましたら、どうかよろしくお願致します。 CSSは以下のように記述しています。 ul { float: left; margin: 0px; padding: 0px; list-style: none; margin-top: 45px; } li { width: 150px; background-repeat: no-repeat; padding-left: 13px; padding-bottom: 0px; height: 140px; float: left; vertical-align: bottom; margin-bottom: 0px; }
- ベストアンサー
- HTML
- IE6でfloatされない。
IE6でfloatされない。 横幅950pxのコンテンツの中に divで3つのboxを作って横一列に並べているのですが ie7,8, firefoxでは意図した通りに表示されますがie6ではdiv id="c"(下記ソース)がfloatされません、どなたか解決策をご指導お願いします。 <div id="a"><img src="img/left.png" width="403" height="240" alt="スペース左" title="" /></div> <div id="b"><iframe name="iframe3" id="iframe3" frameborder="0" scrolling="no" src="home.html" title="******">*******</iframe></div> <div id="c"><img src="img/right.png" width="403" height="240" alt="スペース右" title="" /></div> css記述は下記の通りです #a{ padding-top : 0px; padding-left : 0px; padding-right : 0px; padding-bottom : 0px; margin-top : 0px; margin-left : 0px; margin-right : 0px; margin-bottom : 0px; width : 403px; height : 240px; float : left; display : inline; } #b{ padding-top : 0px; padding-left : 0px; padding-right : 0px; padding-bottom : 0px; margin-top : 0px; margin-left : 0px; margin-right : 0px; margin-bottom : 0px; width : 144px; height : 240px; float : left; display : inline; } #c{ padding-top : 0px; padding-left : 0px; padding-right : 0px; padding-bottom : 0px; margin-top : 0px; margin-left : 0px; margin-right : 0px; margin-bottom : 0px; width : 403px; height : 240px; float : left; display : inline; } #iframe3{ border-width : 0px 0px 0px 0px; margin-left : 0px; width : 144px; height : 240px; padding-top : 0px; overflow : hidden; margin-top : 0px; margin-right : 0px; margin-bottom : 0px; padding-bottom : 0px; padding-left : 0px; padding-right : 0px; } 宜しくお願いします。
- 締切済み
- HTML
- 仕様書に「Margins: Top 0.5"」とあるのですが、このダブルクォーテは何を表すのですか?
仕様書に「Margins: Top 0.5", Bottom 0.5", Left 0.1875", Right 0.1875"」とあるのですが、このダブルクォーテ(")は何をあらわすのですか?ミリですか? 仕様書:http://www.worldlabel.com/Pages/wl-ol875.htm
- ベストアンサー
- 数学・算数
- C# PanelのRegion設定について
ボタンクリックにてPanelのRegion領域を変更したいのですが、勝手にリサイズされて困っております。 panel1の初期Location.X=0,Location.Y=0 のときはうまくいくのですが、初期Locationに値が入ると、矩形領域自体がリサイズされてしまいます。 (矩形領域が小さくなります。) なお、下記コードはテスト様に作成したもので、panel1のサイズを取得して、GraphicsPath からRegionを設定しています。 同じサイズなので、変化はないハズなのですが、初期Locationに値を設定すると、リサイズされてしまいます。 panel1のプロパティは panelのAutoSize=False Dock=None Margin=0,0,0,0 です。 private void button1_Click(object sender, EventArgs e) { Rectangle rect = new Rectangle(panel1.Location.X,panel1.Location.Y, panel1.Width,panel1.Height); GraphicsPath path = GetRoundRect(rect, 10); Graphics g = CreateGraphics(); g.SmoothingMode = SmoothingMode.AntiAlias; panel1.Region = new Region(path); } public GraphicsPath GetRoundRect(Rectangle rect, int radius) { path.StartFigure(); path.AddLine(rect.Left, rect.Top, rect.Right, rect.Top); path.AddLine(rect.Right, rect.Top,rect.Right, rect.Bottom); path.AddLine(rect.Right, rect.Bottom,rect.Left, rect.Bottom); path.AddLine(rect.Left, rect.Bottom,rect.Left, rect.Top); path.CloseFigure(); return path; } アドバイスよろしくお願いいたします。
- ベストアンサー
- その他(プログラミング・開発)
- 横線の書き方
CSSを使って横線を記述しようとしています。 こんな感じで書きました。 css------------------- .udl5 { margin-right: 5px; margin-left: 5px; margin-top: 3px; margin-bottom: 1px; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-width: 1px; border-top-style: solid; border-top-color: #666666; border-bottom-style: none; border-bottom-width: 0px; width: 600px; height: 1px; } ----------------------------------------------- html------------------------------------------- <div class="udl5"></div> ----------------------------------------------- こんな感じで記述したのですがIE7ではちゃんと 表示されるのですが、IE6だと線の下に10pxぐらいの 空欄ができてしまいます。 なぜでしょうか? もし知っている方がいれば教えていただければと思います。 よろしくお願いします。
- 締切済み
- HTML
お礼
良く理解出来ました ありがとうございました お陰で助かりました これからも宜しくお願い申上げます