ImageExtensionsSaveAsIcon(Image, String, Boolean) Method
Saves the specified
image as an Icon without relying on a built-in encoder in the operating system.
Unlike the
Save(Stream, ImageFormat) method, this one supports every
PixelFormat and does not save a PNG stream when no built-in Icon encoder can be found in the operating system.
See the
Remarks section of the
SaveAsIcon(Image, Stream, Boolean) overload for details.
Namespace: KGySoft.DrawingAssembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 8.1.0
public static void SaveAsIcon(
this Image image,
string fileName,
bool forceUncompressedResult = false
)
<ExtensionAttribute>
Public Shared Sub SaveAsIcon (
image As Image,
fileName As String,
Optional forceUncompressedResult As Boolean = false
)
public:
[ExtensionAttribute]
static void SaveAsIcon(
Image^ image,
String^ fileName,
bool forceUncompressedResult = false
)
[<ExtensionAttribute>]
static member SaveAsIcon :
image : Image *
fileName : string *
?forceUncompressedResult : bool
(* Defaults:
let _forceUncompressedResult = defaultArg forceUncompressedResult false
*)
-> unit
- image Image
- The image to save. If contains multiple images other than multi-resolution icon bitmaps, then only the current frame will be saved.
- fileName String
- The name of the file to which to save the image. The directory of the specified path is created if it does not exist.
- forceUncompressedResult Boolean (Optional)
- to force saving an uncompressed icon;
to allow PNG compression, which is supported by Windows Vista and above. This parameter is optional.
Default value: .
In Visual Basic and C#, you can call this method as an instance method on any object of type
Image. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).