Compartir a través de


DpiHelper.LogicalToDeviceUnits Method

Definition

Overloads

LogicalToDeviceUnits(ImageList, Color, ImageScalingMode)

Converts (if necessary) the imagelist by scaling it to device units. When displayed on the device, the scaled imagelist will have same size as the original imagelist would have when displayed at 96dpi.

LogicalToDeviceUnits(Image, Color, ImageScalingMode)

Converts (if necessary) the image by scaling it to device units. When displayed on the device, the scaled image will have same size as the original image would have when displayed at 96dpi.

LogicalToDeviceUnits(Bitmap, Size, ImageScalingMode)

Converts (if necessary) the image strip to 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.

LogicalToDeviceUnits(Bitmap, Color, ImageScalingMode)

Converts (if necessary) the image by scaling it to device units. When displayed on the device, the scaled image will have same size as the original image would have when displayed at 96dpi.

LogicalToDeviceUnits(ImageList, ImageScalingMode)

Converts (if necessary) the imagelist by scaling it to device units. When displayed on the device, the scaled imagelist will have same size as the original imagelist would have when displayed at 96dpi.

LogicalToDeviceUnits(Image, ImageScalingMode)

Converts (if necessary) the image by scaling it to device units. When displayed on the device, the scaled image will have same size as the original image would have when displayed at 96dpi.

LogicalToDeviceUnits(Icon, ImageScalingMode)

Converts (if necessary) the icon by scaling it to device units. When displayed on the device, the scaled icon will have same size as the original icon would have when displayed at 96dpi.

LogicalToDeviceUnits(Bitmap, ImageScalingMode)

Converts (if necessary) the image by scaling it to device units. When displayed on the device, the scaled image will have same size as the original image would have when displayed at 96dpi.

LogicalToDeviceUnits(Thickness)

Returns a new Thickness with the input's dimensions converted from logical units to device units.

LogicalToDeviceUnits(Bitmap, Size, Color, ImageScalingMode)

Converts (if necessary) the image strip to 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.

LogicalToDeviceUnits(Rect)

Returns a new Rect with the input's coordinates converted from logical units to device units.

LogicalToDeviceUnits(Point)

Returns a new Point with the input's coordinates converted from logical units to device units.

LogicalToDeviceUnits(SizeF)

Returns a new System.Drawing.SizeF with the input's coordinates converted from logical units to device units.

LogicalToDeviceUnits(Size)

Returns a new System.Drawing.Size with the input's coordinates converted from logical units to device units.

LogicalToDeviceUnits(RectangleF)

Returns a new System.Drawing.RectangleF with the input's coordinates converted from logical units to device units.

LogicalToDeviceUnits(Rectangle)

Returns a new System.Drawing.Rectangle with the input's coordinates converted from logical units to device units.

LogicalToDeviceUnits(PointF)

Returns a new System.Drawing.PointF with the input's coordinates converted from logical units to device units.

LogicalToDeviceUnits(Point)

Returns a new System.Drawing.Point with the input's coordinates converted from logical units to device units.

LogicalToDeviceUnits(Size)

Returns a new Size with the input's dimensions converted from logical units to device units.

LogicalToDeviceUnits(ImageList, Color, ImageScalingMode)

Converts (if necessary) the imagelist by scaling it to 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 void LogicalToDeviceUnits (ref System.Windows.Forms.ImageList imageList, System.Drawing.Color backgroundColor, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
member this.LogicalToDeviceUnits : ImageList * System.Drawing.Color * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> unit
Public Sub LogicalToDeviceUnits (ByRef imageList As ImageList, backgroundColor As Color, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default)

Parameters

imageList
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 images in the imagelist

Applies to

LogicalToDeviceUnits(Image, Color, ImageScalingMode)

Converts (if necessary) the image by scaling it to 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 void LogicalToDeviceUnits (ref System.Drawing.Image image, System.Drawing.Color backgroundColor, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
member this.LogicalToDeviceUnits : Image * System.Drawing.Color * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> unit
Public Sub LogicalToDeviceUnits (ByRef image As Image, backgroundColor As Color, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default)

Parameters

image
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

Applies to

LogicalToDeviceUnits(Bitmap, Size, ImageScalingMode)

Converts (if necessary) the image strip to 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 void LogicalToDeviceUnits (ref System.Drawing.Bitmap imageStrip, System.Drawing.Size logicalImageSize, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
member this.LogicalToDeviceUnits : Bitmap * System.Drawing.Size * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> unit
Public Sub LogicalToDeviceUnits (ByRef imageStrip As Bitmap, logicalImageSize As Size, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default)

Parameters

imageStrip
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

Applies to

LogicalToDeviceUnits(Bitmap, Color, ImageScalingMode)

Converts (if necessary) the image by scaling it to 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 void LogicalToDeviceUnits (ref System.Drawing.Bitmap bitmapImage, System.Drawing.Color backgroundColor, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
member this.LogicalToDeviceUnits : Bitmap * System.Drawing.Color * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> unit
Public Sub LogicalToDeviceUnits (ByRef bitmapImage As Bitmap, backgroundColor As Color, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default)

Parameters

bitmapImage
Bitmap

The bitmap 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

Applies to

LogicalToDeviceUnits(ImageList, ImageScalingMode)

Converts (if necessary) the imagelist by scaling it to 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 void LogicalToDeviceUnits (ref System.Windows.Forms.ImageList imageList, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
member this.LogicalToDeviceUnits : ImageList * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> unit
Public Sub LogicalToDeviceUnits (ByRef imageList As ImageList, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default)

Parameters

imageList
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

Applies to

LogicalToDeviceUnits(Image, ImageScalingMode)

Converts (if necessary) the image by scaling it to 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 void LogicalToDeviceUnits (ref System.Drawing.Image image, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
member this.LogicalToDeviceUnits : Image * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> unit
Public Sub LogicalToDeviceUnits (ByRef image As Image, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default)

Parameters

image
Image

The image to scale from logical units to device units

scalingMode
ImageScalingMode

The scaling mode to use when scaling the image. When the interpolation mode is Bilinear or Bicubic, a transparent color will be used for background and the image's magins will be interpolated with the background. As result, the returned image will use alpha blending.

Applies to

LogicalToDeviceUnits(Icon, ImageScalingMode)

Converts (if necessary) the icon by scaling it to 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 void LogicalToDeviceUnits (ref System.Drawing.Icon icon, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
member this.LogicalToDeviceUnits : Icon * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> unit
Public Sub LogicalToDeviceUnits (ByRef icon As Icon, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default)

Parameters

icon
Icon

The icon to scale from logical units to device units

scalingMode
ImageScalingMode

Applies to

LogicalToDeviceUnits(Bitmap, ImageScalingMode)

Converts (if necessary) the image by scaling it to 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 void LogicalToDeviceUnits (ref System.Drawing.Bitmap bitmapImage, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
member this.LogicalToDeviceUnits : Bitmap * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> unit
Public Sub LogicalToDeviceUnits (ByRef bitmapImage As Bitmap, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default)

Parameters

bitmapImage
Bitmap

The bitmap image to scale from logical units to device units

scalingMode
ImageScalingMode

The scaling mode to use when scaling the image. When the interpolation mode is Bilinear or Bicubic, a transparent color will be used for background and the image's magins will be interpolated with the background. As result, the returned image will use alpha blending.

Applies to

LogicalToDeviceUnits(Thickness)

Returns a new Thickness with the input's dimensions converted from logical units to device units.

public:
 System::Windows::Thickness LogicalToDeviceUnits(System::Windows::Thickness logicalThickness);
public System.Windows.Thickness LogicalToDeviceUnits (System.Windows.Thickness logicalThickness);
member this.LogicalToDeviceUnits : System.Windows.Thickness -> System.Windows.Thickness
Public Function LogicalToDeviceUnits (logicalThickness As Thickness) As Thickness

Parameters

logicalThickness
Thickness

Thickness in logical units

Returns

Thickness in device units

Applies to

LogicalToDeviceUnits(Bitmap, Size, Color, ImageScalingMode)

Converts (if necessary) the image strip to 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 void LogicalToDeviceUnits (ref System.Drawing.Bitmap imageStrip, System.Drawing.Size logicalImageSize, System.Drawing.Color backgroundColor, Microsoft.VisualStudio.PlatformUI.ImageScalingMode scalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default);
member this.LogicalToDeviceUnits : Bitmap * System.Drawing.Size * System.Drawing.Color * Microsoft.VisualStudio.PlatformUI.ImageScalingMode -> unit
Public Sub LogicalToDeviceUnits (ByRef imageStrip As Bitmap, logicalImageSize As Size, backgroundColor As Color, Optional scalingMode As ImageScalingMode = Microsoft.VisualStudio.PlatformUI.ImageScalingMode.Default)

Parameters

imageStrip
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

Applies to

LogicalToDeviceUnits(Rect)

Returns a new Rect with the input's coordinates converted from logical units to device units.

public:
 System::Windows::Rect LogicalToDeviceUnits(System::Windows::Rect logicalRect);
public System.Windows.Rect LogicalToDeviceUnits (System.Windows.Rect logicalRect);
member this.LogicalToDeviceUnits : System.Windows.Rect -> System.Windows.Rect
Public Function LogicalToDeviceUnits (logicalRect As Rect) As Rect

Parameters

logicalRect
Rect

Rect in logical coordinates

Returns

Rect in device coordinates

Applies to

LogicalToDeviceUnits(Point)

Returns a new Point with the input's coordinates converted from logical units to device units.

public:
 System::Windows::Point LogicalToDeviceUnits(System::Windows::Point logicalPoint);
public System.Windows.Point LogicalToDeviceUnits (System.Windows.Point logicalPoint);
member this.LogicalToDeviceUnits : System.Windows.Point -> System.Windows.Point
Public Function LogicalToDeviceUnits (logicalPoint As Point) As Point

Parameters

logicalPoint
Point

Point in logical units

Returns

Point in device coordinates

Applies to

LogicalToDeviceUnits(SizeF)

Returns a new System.Drawing.SizeF with the input's coordinates converted from logical units to device units.

public:
 System::Drawing::SizeF LogicalToDeviceUnits(System::Drawing::SizeF logicalSize);
public System.Drawing.SizeF LogicalToDeviceUnits (System.Drawing.SizeF logicalSize);
member this.LogicalToDeviceUnits : System.Drawing.SizeF -> System.Drawing.SizeF
Public Function LogicalToDeviceUnits (logicalSize As SizeF) As SizeF

Parameters

logicalSize
SizeF

SizeF in logical units

Returns

SizeF in device coordinates

Applies to

LogicalToDeviceUnits(Size)

Returns a new System.Drawing.Size with the input's coordinates converted from logical units to device units.

public:
 System::Drawing::Size LogicalToDeviceUnits(System::Drawing::Size logicalSize);
public System.Drawing.Size LogicalToDeviceUnits (System.Drawing.Size logicalSize);
member this.LogicalToDeviceUnits : System.Drawing.Size -> System.Drawing.Size
Public Function LogicalToDeviceUnits (logicalSize As Size) As Size

Parameters

logicalSize
Size

Size in logical units

Returns

Size in device coordinates

Applies to

LogicalToDeviceUnits(RectangleF)

Returns a new System.Drawing.RectangleF with the input's coordinates converted from logical units to device units.

public:
 System::Drawing::RectangleF LogicalToDeviceUnits(System::Drawing::RectangleF logicalRect);
public System.Drawing.RectangleF LogicalToDeviceUnits (System.Drawing.RectangleF logicalRect);
member this.LogicalToDeviceUnits : System.Drawing.RectangleF -> System.Drawing.RectangleF
Public Function LogicalToDeviceUnits (logicalRect As RectangleF) As RectangleF

Parameters

logicalRect
RectangleF

RectangleF in logical units

Returns

RectangleF in device coordinates

Applies to

LogicalToDeviceUnits(Rectangle)

Returns a new System.Drawing.Rectangle with the input's coordinates converted from logical units to device units.

public:
 System::Drawing::Rectangle LogicalToDeviceUnits(System::Drawing::Rectangle logicalRect);
public System.Drawing.Rectangle LogicalToDeviceUnits (System.Drawing.Rectangle logicalRect);
member this.LogicalToDeviceUnits : System.Drawing.Rectangle -> System.Drawing.Rectangle
Public Function LogicalToDeviceUnits (logicalRect As Rectangle) As Rectangle

Parameters

logicalRect
Rectangle

Rectangle in logical units

Returns

Rectangle in device coordinates

Applies to

LogicalToDeviceUnits(PointF)

Returns a new System.Drawing.PointF with the input's coordinates converted from logical units to device units.

public:
 System::Drawing::PointF LogicalToDeviceUnits(System::Drawing::PointF logicalPoint);
public System.Drawing.PointF LogicalToDeviceUnits (System.Drawing.PointF logicalPoint);
member this.LogicalToDeviceUnits : System.Drawing.PointF -> System.Drawing.PointF
Public Function LogicalToDeviceUnits (logicalPoint As PointF) As PointF

Parameters

logicalPoint
PointF

PointF in logical units

Returns

PointF in device coordinates

Applies to

LogicalToDeviceUnits(Point)

Returns a new System.Drawing.Point with the input's coordinates converted from logical units to device units.

public:
 System::Drawing::Point LogicalToDeviceUnits(System::Drawing::Point logicalPoint);
public System.Drawing.Point LogicalToDeviceUnits (System.Drawing.Point logicalPoint);
member this.LogicalToDeviceUnits : System.Drawing.Point -> System.Drawing.Point
Public Function LogicalToDeviceUnits (logicalPoint As Point) As Point

Parameters

logicalPoint
Point

Point in logical units

Returns

Point in device coordinates

Applies to

LogicalToDeviceUnits(Size)

Returns a new Size with the input's dimensions converted from logical units to device units.

public:
 System::Windows::Size LogicalToDeviceUnits(System::Windows::Size logicalSize);
public System.Windows.Size LogicalToDeviceUnits (System.Windows.Size logicalSize);
member this.LogicalToDeviceUnits : System.Windows.Size -> System.Windows.Size
Public Function LogicalToDeviceUnits (logicalSize As Size) As Size

Parameters

logicalSize
Size

Size in logical units

Returns

Size in device units

Applies to