Graphics.DrawImageUnscaled 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在座標對指定的位置,依照原始物理尺寸繪製指定的影像。
多載
| 名稱 | Description |
|---|---|
| DrawImageUnscaled(Image, Int32, Int32) |
在座標對指定的位置,依照原始物理尺寸繪製指定的影像。 |
| DrawImageUnscaled(Image, Int32, Int32, Int32, Int32) |
在指定位置,使用原始實體尺寸繪製指定的圖像。 |
| DrawImageUnscaled(Image, Point) |
在指定位置,使用原始實體尺寸繪製指定的圖像。 |
| DrawImageUnscaled(Image, Rectangle) |
在指定位置,使用原始實體尺寸繪製指定的圖像。 |
DrawImageUnscaled(Image, Int32, Int32)
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
在座標對指定的位置,依照原始物理尺寸繪製指定的影像。
public:
void DrawImageUnscaled(System::Drawing::Image ^ image, int x, int y);
public void DrawImageUnscaled(System.Drawing.Image image, int x, int y);
member this.DrawImageUnscaled : System.Drawing.Image * int * int -> unit
Public Sub DrawImageUnscaled (image As Image, x As Integer, y As Integer)
參數
- x
- Int32
繪製影像左上角的 X 座標。
- y
- Int32
繪製影像左上角的 Y 座標。
例外狀況
image 是 null。
範例
以下程式碼範例是為 Windows Forms 設計的,並需要 PaintEventArgse,這是 Paint 事件處理程序的參數。 此程式碼會執行下列動作:
從範例資料夾中的 JPEG 檔案 SampImag.jpg建立一張圖片。
建立一個點,讓畫面左上角可以畫出來。
用圖像的實體尺寸來繪製整幅圖像。
public:
void DrawImageUnscaledInt( PaintEventArgs^ e )
{
// Create image.
Image^ newImage = Image::FromFile( "SampImag.jpg" );
// Create coordinates for upper-left corner of image.
int x = 100;
int y = 100;
// Draw image to screen.
e->Graphics->DrawImageUnscaled( newImage, x, y );
}
public void DrawImageUnscaledInt(PaintEventArgs e)
{
// Create image.
Image newImage = Image.FromFile("SampImag.jpg");
// Create coordinates for upper-left corner of image.
int x = 100;
int y = 100;
// Draw image to screen.
e.Graphics.DrawImageUnscaled(newImage, x, y);
}
Public Sub DrawImageUnscaledInt(ByVal e As PaintEventArgs)
' Create image.
Dim newImage As Image = Image.FromFile("SampImag.jpg")
' Create coordinates for upper-left corner of image.
Dim x As Integer = 100
Dim y As Integer = 100
' Draw image to screen.
e.Graphics.DrawImageUnscaled(newImage, x, y)
End Sub
備註
An Image 儲存像素寬度值與水平解析度值(每英吋點數)。 以英吋為單位的影像實體寬度是像素寬度除以水平解析度。 例如,圖元寬度為 216 的影像,而水平解析度為每英吋 72 個點,其實體寬度為 3 英吋。 類似的備註適用於圖元高度和實體高度。
此 DrawImageUnscaled 方法使用影像的物理尺寸繪製,因此無論顯示裝置的解析度(每英吋點數)如何,影像都會有正確的英吋大小。 例如,假設影像的圖元寬度為 216,而水平解析度為每英吋 72 點。 如果你呼叫 DrawImageUnscaled 在解析度為 96 點每英吋的裝置上繪製該影像,渲染出來的像素寬度將是 (216/72)*96 = 288。
適用於
DrawImageUnscaled(Image, Int32, Int32, Int32, Int32)
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
在指定位置,使用原始實體尺寸繪製指定的圖像。
public:
void DrawImageUnscaled(System::Drawing::Image ^ image, int x, int y, int width, int height);
public void DrawImageUnscaled(System.Drawing.Image image, int x, int y, int width, int height);
member this.DrawImageUnscaled : System.Drawing.Image * int * int * int * int -> unit
Public Sub DrawImageUnscaled (image As Image, x As Integer, y As Integer, width As Integer, height As Integer)
參數
- x
- Int32
繪製影像左上角的 X 座標。
- y
- Int32
繪製影像左上角的 Y 座標。
- width
- Int32
未使用。
- height
- Int32
未使用。
例外狀況
image 是 null。
備註
An Image 儲存像素寬度值與水平解析度值(每英吋點數)。 以英吋為單位的影像實體寬度是像素寬度除以水平解析度。 例如,圖元寬度為 216 的影像,而水平解析度為每英吋 72 個點,其實體寬度為 3 英吋。 類似的備註適用於圖元高度和實體高度。
此 DrawImageUnscaled 方法使用影像的物理尺寸繪製,因此無論顯示裝置的解析度(每英吋點數)如何,影像都會有正確的英吋大小。 例如,假設影像的圖元寬度為 216,而水平解析度為每英吋 72 點。 如果你呼叫 DrawImageUnscaled 在解析度為 96 點每英吋的裝置上繪製該影像,渲染出來的像素寬度將是 (216/72)*96 = 288。
適用於
DrawImageUnscaled(Image, Point)
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
在指定位置,使用原始實體尺寸繪製指定的圖像。
public:
void DrawImageUnscaled(System::Drawing::Image ^ image, System::Drawing::Point point);
public void DrawImageUnscaled(System.Drawing.Image image, System.Drawing.Point point);
member this.DrawImageUnscaled : System.Drawing.Image * System.Drawing.Point -> unit
Public Sub DrawImageUnscaled (image As Image, point As Point)
參數
例外狀況
image 是 null。
範例
以下程式碼範例是為 Windows Forms 設計的,並需要 PaintEventArgse,這是 Paint 事件處理程序的參數。 此程式碼會執行下列動作:
從範例資料夾中的 JPEG 檔案 SampImag.jpg 產生影像。
建立一個點,讓畫面左上角可以畫出來。
用圖像的實體尺寸來繪製整幅圖像。
public:
void DrawImageUnscaledPoint( PaintEventArgs^ e )
{
// Create image.
Image^ newImage = Image::FromFile( "SampImag.jpg" );
// Create point for upper-left corner of image.
Point ulCorner = Point(100,100);
// Draw image to screen.
e->Graphics->DrawImageUnscaled( newImage, ulCorner );
}
public void DrawImageUnscaledPoint(PaintEventArgs e)
{
// Create image.
Image newImage = Image.FromFile("SampImag.jpg");
// Create point for upper-left corner of image.
Point ulCorner = new Point(100, 100);
// Draw image to screen.
e.Graphics.DrawImageUnscaled(newImage, ulCorner);
}
Public Sub DrawImageUnscaledPoint(ByVal e As PaintEventArgs)
' Create image.
Dim newImage As Image = Image.FromFile("SampImag.jpg")
' Create point for upper-left corner of image.
Dim ulCorner As New Point(100, 100)
' Draw image to screen.
e.Graphics.DrawImageUnscaled(newImage, ulCorner)
End Sub
備註
An Image 儲存像素寬度值與水平解析度值(每英吋點數)。 以英吋為單位的影像實體寬度是像素寬度除以水平解析度。 例如,圖元寬度為 216 的影像,而水平解析度為每英吋 72 個點,其實體寬度為 3 英吋。 類似的備註適用於圖元高度和實體高度。
此 DrawImageUnscaled 方法使用影像的物理尺寸繪製,因此無論顯示裝置的解析度(每英吋點數)如何,影像都會有正確的英吋大小。 例如,假設影像的圖元寬度為 216,而水平解析度為每英吋 72 點。 如果你呼叫 DrawImageUnscaled 在解析度為 96 點每英吋的裝置上繪製該影像,渲染出來的像素寬度將是 (216/72)*96 = 288。
適用於
DrawImageUnscaled(Image, Rectangle)
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
在指定位置,使用原始實體尺寸繪製指定的圖像。
public:
void DrawImageUnscaled(System::Drawing::Image ^ image, System::Drawing::Rectangle rect);
public void DrawImageUnscaled(System.Drawing.Image image, System.Drawing.Rectangle rect);
member this.DrawImageUnscaled : System.Drawing.Image * System.Drawing.Rectangle -> unit
Public Sub DrawImageUnscaled (image As Image, rect As Rectangle)
參數
例外狀況
image 是 null。
備註
An Image 儲存像素寬度值與水平解析度值(每英吋點數)。 以英吋為單位的影像實體寬度是像素寬度除以水平解析度。 例如,圖元寬度為 216 的影像,而水平解析度為每英吋 72 個點,其實體寬度為 3 英吋。 類似的備註適用於圖元高度和實體高度。
此 DrawImageUnscaled 方法使用影像的物理尺寸繪製,因此無論顯示裝置的解析度(每英吋點數)如何,影像都會有正確的英吋大小。 例如,假設影像的圖元寬度為 216,而水平解析度為每英吋 72 點。 如果你呼叫 DrawImageUnscaled 在解析度為 96 點每英吋的裝置上繪製該影像,渲染出來的像素寬度將是 (216/72)*96 = 288。