Partager via


DpiHelper.CreateDeviceFromLogicalImage Method

Definition

Overloads

CreateDeviceFromLogicalImage(Icon, ImageScalingMode)
Obsolete.

Creates and returns a new icon scaled for the device units. When displayed on the device, the scaled icon will have same size as the original icon would have when displayed at 96dpi.

CreateDeviceFromLogicalImage(Image, ImageScalingMode)
Obsolete.

Extension method for System.Drawing.Image that creates and returns a new bitmap or metafile scaled for the device units. When displayed on the device, the scaled image will have same size as the original image would have when displayed at 96dpi.

CreateDeviceFromLogicalImage(ImageList, ImageScalingMode)
Obsolete.

Creates and returns a new imagelist scaled for the device units When displayed on the device, the scaled imagelist will have same size as the original imagelist would have when displayed at 96dpi.

CreateDeviceFromLogicalImage(Bitmap, Size, ImageScalingMode)
Obsolete.

Extension method for System.Drawing.Bitmap that creates and returns a new bitmap strip scaled for the device units, using NearestNeighbor interpolation. When displayed on the device, the scaled image strip will have same size as the original image strip would have when displayed at 96dpi.

This should be used for converting imagelists bitmap strips instead of simply scaling the bitmap, because the resultant bitmap strip size may be different from just upscaling as bitmap N * Math.Round(width * dpiscale) != Math.Round(N * width * dpiscale) This may happen depending on the image width because dpiscale is a double not an int.

CreateDeviceFromLogicalImage(Image, Color, ImageScalingMode)
Obsolete.

Extension method for System.Drawing.Image that creates and returns a new bitmap or metafile scaled for the device units. When displayed on the device, the scaled image will have same size as the original image would have when displayed at 96dpi.

CreateDeviceFromLogicalImage(ImageList, Color, ImageScalingMode)
Obsolete.

Creates and returns a new imagelist scaled for the device units When displayed on the device, the scaled imagelist will have same size as the original imagelist would have when displayed at 96dpi.

CreateDeviceFromLogicalImage(Bitmap, Size, Color, ImageScalingMode)
Obsolete.

Extension method for System.Drawing.Bitmap that creates and returns a new bitmap strip scaled for the device units When displayed on the device, the scaled image strip will have same size as the original image strip would have when displayed at 96dpi.

This should be used for converting imagelists bitmap strips instead of simply scaling the bitmap, because the resultant bitmap strip size may be different from just upscaling as bitmap N * Math.Round(width * dpiscale) != Math.Round(N * width * dpiscale) This may happen depending on the image width because dpiscale is a double not an int.

CreateDeviceFromLogicalImage(Icon, ImageScalingMode)

Caution

Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.

Creates and returns a new icon scaled for the device units. When displayed on the device, the scaled icon will have same size as the original icon would have when displayed at 96dpi.

public static System.Drawing.Icon CreateDeviceFromLogicalImage (this System.Drawing.Icon logicalIcon, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
[System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")]
public static System.Drawing.Icon CreateDeviceFromLogicalImage (this System.Drawing.Icon logicalIcon, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
static member CreateDeviceFromLogicalImage : System.Drawing.Icon * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Drawing.Icon
[<System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")>]
static member CreateDeviceFromLogicalImage : System.Drawing.Icon * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Drawing.Icon
<Extension()>
Public Function CreateDeviceFromLogicalImage (logicalIcon As Icon, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default) As Icon

Parameters

logicalIcon
Icon

The icon to scale from logical units to device units

scalingMode
ImageScalingMode

The scaling mode to use when scaling the image

Returns

Returns Icon.

Attributes

Applies to

CreateDeviceFromLogicalImage(Image, ImageScalingMode)

Caution

Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.

Extension method for System.Drawing.Image that creates and returns a new bitmap or metafile scaled for the device units. When displayed on the device, the scaled image will have same size as the original image would have when displayed at 96dpi.

public static System.Drawing.Image CreateDeviceFromLogicalImage (this System.Drawing.Image logicalImage, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
[System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")]
public static System.Drawing.Image CreateDeviceFromLogicalImage (this System.Drawing.Image logicalImage, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
static member CreateDeviceFromLogicalImage : System.Drawing.Image * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Drawing.Image
[<System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")>]
static member CreateDeviceFromLogicalImage : System.Drawing.Image * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Drawing.Image
<Extension()>
Public Function CreateDeviceFromLogicalImage (logicalImage As Image, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default) As Image

Parameters

logicalImage
Image

The image to scale from logical units to device units

scalingMode
ImageScalingMode

The scaling mode to use when scaling the image

Returns

The image.

Attributes

Applies to

CreateDeviceFromLogicalImage(ImageList, ImageScalingMode)

Caution

Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.

Creates and returns a new imagelist scaled for the device units When displayed on the device, the scaled imagelist will have same size as the original imagelist would have when displayed at 96dpi.

public static System.Windows.Forms.ImageList CreateDeviceFromLogicalImage (this System.Windows.Forms.ImageList logicalImageList, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
[System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")]
public static System.Windows.Forms.ImageList CreateDeviceFromLogicalImage (this System.Windows.Forms.ImageList logicalImageList, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
static member CreateDeviceFromLogicalImage : System.Windows.Forms.ImageList * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Windows.Forms.ImageList
[<System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")>]
static member CreateDeviceFromLogicalImage : System.Windows.Forms.ImageList * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Windows.Forms.ImageList
<Extension()>
Public Function CreateDeviceFromLogicalImage (logicalImageList As ImageList, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default) As ImageList

Parameters

logicalImageList
ImageList

The imagelist to scale from logical units to device units

scalingMode
ImageScalingMode

The scaling mode to use when scaling the images in the imagelist

Returns

The image.

Attributes

Applies to

CreateDeviceFromLogicalImage(Bitmap, Size, ImageScalingMode)

Caution

Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.

Extension method for System.Drawing.Bitmap that creates and returns a new bitmap strip scaled for the device units, using NearestNeighbor interpolation. When displayed on the device, the scaled image strip will have same size as the original image strip would have when displayed at 96dpi.

This should be used for converting imagelists bitmap strips instead of simply scaling the bitmap, because the resultant bitmap strip size may be different from just upscaling as bitmap N * Math.Round(width * dpiscale) != Math.Round(N * width * dpiscale) This may happen depending on the image width because dpiscale is a double not an int.

public static System.Drawing.Bitmap CreateDeviceFromLogicalImage (this System.Drawing.Bitmap logicalBitmapStrip, System.Drawing.Size logicalImageSize, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
[System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")]
public static System.Drawing.Bitmap CreateDeviceFromLogicalImage (this System.Drawing.Bitmap logicalBitmapStrip, System.Drawing.Size logicalImageSize, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
static member CreateDeviceFromLogicalImage : System.Drawing.Bitmap * System.Drawing.Size * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Drawing.Bitmap
[<System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")>]
static member CreateDeviceFromLogicalImage : System.Drawing.Bitmap * System.Drawing.Size * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Drawing.Bitmap
<Extension()>
Public Function CreateDeviceFromLogicalImage (logicalBitmapStrip As Bitmap, logicalImageSize As Size, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default) As Bitmap

Parameters

logicalBitmapStrip
Bitmap

The image strip to scale from logical units to device units

logicalImageSize
Size

The size in logical unit of each image in the strip

scalingMode
ImageScalingMode

The scaling mode to use when scaling the images in the strip

Returns

The image.

Attributes

Applies to

CreateDeviceFromLogicalImage(Image, Color, ImageScalingMode)

Caution

Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.

Extension method for System.Drawing.Image that creates and returns a new bitmap or metafile scaled for the device units. When displayed on the device, the scaled image will have same size as the original image would have when displayed at 96dpi.

public static System.Drawing.Image CreateDeviceFromLogicalImage (this System.Drawing.Image logicalImage, System.Drawing.Color backgroundColor, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
[System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")]
public static System.Drawing.Image CreateDeviceFromLogicalImage (this System.Drawing.Image logicalImage, System.Drawing.Color backgroundColor, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
static member CreateDeviceFromLogicalImage : System.Drawing.Image * System.Drawing.Color * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Drawing.Image
[<System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")>]
static member CreateDeviceFromLogicalImage : System.Drawing.Image * System.Drawing.Color * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Drawing.Image
<Extension()>
Public Function CreateDeviceFromLogicalImage (logicalImage As Image, backgroundColor As Color, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default) As Image

Parameters

logicalImage
Image

The image to scale from logical units to device units

backgroundColor
Color

A Color value to be used for the image background. When the interpolation mode is Bilinear or Bicubic, the image's margins are interpolated with the background.

scalingMode
ImageScalingMode

The scaling mode to use when scaling the image

Returns

The image.

Attributes

Applies to

CreateDeviceFromLogicalImage(ImageList, Color, ImageScalingMode)

Caution

Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.

Creates and returns a new imagelist scaled for the device units When displayed on the device, the scaled imagelist will have same size as the original imagelist would have when displayed at 96dpi.

public static System.Windows.Forms.ImageList CreateDeviceFromLogicalImage (this System.Windows.Forms.ImageList logicalImageList, System.Drawing.Color backgroundColor, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
[System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")]
public static System.Windows.Forms.ImageList CreateDeviceFromLogicalImage (this System.Windows.Forms.ImageList logicalImageList, System.Drawing.Color backgroundColor, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
static member CreateDeviceFromLogicalImage : System.Windows.Forms.ImageList * System.Drawing.Color * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Windows.Forms.ImageList
[<System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")>]
static member CreateDeviceFromLogicalImage : System.Windows.Forms.ImageList * System.Drawing.Color * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Windows.Forms.ImageList
<Extension()>
Public Function CreateDeviceFromLogicalImage (logicalImageList As ImageList, backgroundColor As Color, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default) As ImageList

Parameters

logicalImageList
ImageList

The imagelist to scale from logical units to device units

backgroundColor
Color

A Color value to be used for the image background. When the interpolation mode is Bilinear or Bicubic, the image's margins are interpolated with the background.

scalingMode
ImageScalingMode

The scaling mode to use when scaling the imagelist

Returns

The image.

Attributes

Applies to

CreateDeviceFromLogicalImage(Bitmap, Size, Color, ImageScalingMode)

Caution

Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.

Extension method for System.Drawing.Bitmap that creates and returns a new bitmap strip scaled for the device units When displayed on the device, the scaled image strip will have same size as the original image strip would have when displayed at 96dpi.

This should be used for converting imagelists bitmap strips instead of simply scaling the bitmap, because the resultant bitmap strip size may be different from just upscaling as bitmap N * Math.Round(width * dpiscale) != Math.Round(N * width * dpiscale) This may happen depending on the image width because dpiscale is a double not an int.

public static System.Drawing.Bitmap CreateDeviceFromLogicalImage (this System.Drawing.Bitmap logicalBitmapStrip, System.Drawing.Size logicalImageSize, System.Drawing.Color backgroundColor, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
[System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")]
public static System.Drawing.Bitmap CreateDeviceFromLogicalImage (this System.Drawing.Bitmap logicalBitmapStrip, System.Drawing.Size logicalImageSize, System.Drawing.Color backgroundColor, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
static member CreateDeviceFromLogicalImage : System.Drawing.Bitmap * System.Drawing.Size * System.Drawing.Color * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Drawing.Bitmap
[<System.Obsolete("Use the Visual Studio image service and/or Microsoft.VisualStudio.Imaging.CrispImage instead.")>]
static member CreateDeviceFromLogicalImage : System.Drawing.Bitmap * System.Drawing.Size * System.Drawing.Color * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> System.Drawing.Bitmap
<Extension()>
Public Function CreateDeviceFromLogicalImage (logicalBitmapStrip As Bitmap, logicalImageSize As Size, backgroundColor As Color, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default) As Bitmap

Parameters

logicalBitmapStrip
Bitmap

The image strip to scale from logical units to device units

logicalImageSize
Size

The size in logical unit of each image in the strip

backgroundColor
Color

A Color value to be used for the image background. When the interpolation mode is Bilinear or Bicubic, the image's margins are interpolated with the background.

scalingMode
ImageScalingMode

The scaling mode to use when scaling the images in the strip

Returns

The image.

Attributes

Applies to