How to get contentType from System.Drawing.Imaging.ImageFormat

后端 未结 2 1104
遥遥无期
遥遥无期 2021-02-20 03:39

If I have Bitmap and it has RawFormat property.

How can I get Content Type from this ImageFormat object?

Bitmap image = new Bitmap(stream);
ImageFormat i         


        
2条回答
  •  余生分开走
    2021-02-20 04:01

    If you want to determine the MIME type from a file name (or extension), here is a link that uses the registry: Get MimeType from a File Name

提交回复
热议问题