Xwt.Drawing.Image.WithSize C# (CSharp) Method

WithSize() public method

Retuns a copy of the image with a specific size
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public WithSize ( IconSize size ) : Image
size IconSize New size
return Image
        public Image WithSize(IconSize size)
        {
            Size s;

            switch (size) {
            case IconSize.Small: s = new Size (16, 16); break;
            case IconSize.Medium: s = new Size (24, 24); break;
            case IconSize.Large: s = new Size (32, 32); break;
            default: throw new ArgumentOutOfRangeException ("size");
            }

            return new Image (this) {
                requestedSize = s
            };
        }

Same methods

Image::WithSize ( Size size ) : Image
Image::WithSize ( double squaredSize ) : Image
Image::WithSize ( double width, double height ) : Image