Bitmap.SetResolution(Single, Single) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the resolution for this Bitmap.
public:
void SetResolution(float xDpi, float yDpi);
public void SetResolution (float xDpi, float yDpi);
member this.SetResolution : single * single -> unit
Public Sub SetResolution (xDpi As Single, yDpi As Single)
Parameters
Exceptions
The operation failed.
Examples
The following example code shows how to use the SetResolution method.
Bitmap bitmap = new Bitmap(100, 100);
bitmap.SetResolution(96.0F, 96.0F);
Dim bitmap As New Bitmap(100, 100)
bitmap.SetResolution(96F, 96F)
Remarks
Use this method to set the desired resolution on a newly created bitmap. Changing the resolution of the image does not change its physical size.
Applies to
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET