BMP is not a standard, you can use the C + + opencv Python opencv pillow Gdi + Image Magick . Oneself write a small program, converted into a standard BMP format, The following as gdi + application, only supplies the reference: Private Type GdiplusStartupInput GdiplusVersion As Long DebugEventCallback As Long SuppressBackgroundThread As Long SuppressExternalCodecs As Long End Type Private Declare Function GdiplusStartup Lib "gdiplus" (token, As Long As inputbuf GdiplusStartupInput, Optional ByVal outputbuf As Long=0) As Long Private Declare Function GdipCreateBitmapFromScan0 Lib "gdiplus" (ByVal Width As Long, ByVal Height As Long, ByVal stride As Long, ByVal PixelFormat As Long, scan0 As Any, bitmap As Long) As Long Private Declare Function GdipCreatePen1 Lib "gdiplus" (ByVal color As Long, ByVal Width As Single, ByVal unit As Long, pen As Long) As Long Private Declare Function GdipGetImageGraphicsContext Lib "gdiplus" (ByVal Image As Long, graphics As Long) As Long Private Declare Function GdipDrawLine Lib "gdiplus" (ByVal graphics As Long, ByVal pen As Long, ByVal x1 As Single, ByVal y1 As Single, ByVal x2 As Single, ByVal y2 As Single) As Long Private Declare Function CLSIDFromString Lib "ole32" (ByVal LPSZ As Long, pclsid As Any) As Long Private Declare Function GdipSaveImageToFile Lib "gdiplus" (ByVal Image As Long, ByVal filename As Long, clsidEncoder As Any, encoderParams As Any) As Long Private Declare Function GdipDeletePen Lib "gdiplus" (ByVal pen As Long) As Long Private Declare Function GdipDeleteGraphics Lib "gdiplus" (ByVal graphics As Long) As Long Private Declare Function GdipDisposeImage Lib "gdiplus" (ByVal Image) As Long As Long Private Declare Function GdiplusShutdown Lib "gdiplus" (ByVal token As Long) As Long Private Sub Command1_Click () Const PNGFile As String="D: \ 1. PNG" Const PixelFormat32bppARGB As Long=& amp; H26200A Const CLSID_PNG As String="{a04 cf406 557-1-11 d3-9 - a73-0000 f81ef32e}" Dim token As Long Dim GpInput As GdiplusStartupInput Dim ReturnValue As Long Dim bitmap As Long Dim graphics As Long Dim pen As Long Dim PngClsid (15) As Byte Dim Params (7) As Long 'initialize GDI GpInput. GdiplusVersion=1 The ReturnValue=https://bbs.csdn.net/topics/GdiplusStartup (token, GpInput) If the ReturnValue & lt;> 0 Then MsgBox "GDI failed to initialize" : the Exit Sub 'new Bitmap GdipCreateBitmapFromScan0 100, 100, 0, PixelFormat32bppARGB, ByVal 0, bitmap 'new pen GdipCreatePen1 & amp; H80FF0000, 10, 0, translucent red pen ' Draw a line ' GdipGetImageGraphicsContext bitmap, graphics GdipDrawLine graphics, pen, 10, 20, 60, 70 'is saved as a PNG CLSIDFromString StrPtr (CLSID_PNG), PngClsid (0) GdipSaveImageToFile bitmap, StrPtr (PNGFile), PngClsid (0), Params (0) 'sweeping work GdipDeletePen pen GdipDeleteGraphics graphics GdipDisposeImage bitmap GdiplusShutdown token End Sub The Platform SDK: GDI + Retrieving the Class Identifier for an Encoder The function GetEncoderClsid in The following example receives The MIME type of an encoder and returns The class identifier (clsids) of that encoder. The MIME types of The encoders built into GDI + are as follows: Image/BMP Image/jpeg Image/GIF Image/tiff Image/PNG The function calls GetImageEncoders to get an array of ImageCodecInfo objects. If one of The ImageCodecInfo objects in that array represents The requested encoder, The function returns The index of The ImageCodecInfo object and copies The clsids into The variable pointed to by pClsid. If The function fails, it returns - 1. Int GetEncoderClsid (const WCHAR * format, clsids * pClsid) { UINT num=0;//number of image encoders UINT size=0; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull