Files
docs-desktop/dotnet-desktop-guide/framework/winforms/advanced/how-to-convert-a-bmp-image-to-a-png-image.md
T
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

1.4 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Convert a BMP image to a PNG image 03/30/2017
csharp
vb
BMP images [Windows Forms], converting to PNG
image formats [Windows Forms], converting between
9d4a692d-73ac-4ce3-9e05-9ec321e8fbd6

How to: Convert a BMP image to a PNG image

Oftentimes, you will want to convert from one image file format to another. You can do this conversion easily by calling the xref:System.Drawing.Image.Save%2A method of the xref:System.Drawing.Image class and specifying the xref:System.Drawing.Imaging.ImageFormat for the desired image file format.

Example

The following example loads a BMP image from a type, and saves the image in the PNG format.

[!code-csharpUsingImageEncodersDecoders#4] [!code-vbUsingImageEncodersDecoders#4]

Compiling the Code

This example requires:

  • A Windows Forms application.

  • A reference to the System.Drawing.Imaging namespace.

See also