For all emf's except Word's, it was only a few lines:
That's it. How would I set what color it draws to?Code:Public Function gdipImgToFileJPG(hImg As Long, sOut As String) As Long Dim encoderCLSID As CLSIDG Call GetEncoderClsid("image/jpeg", encoderCLSID) Debug.Print "encoder clsid data1=" & Hex$(encoderCLSID.Data1) GdipSaveImageToFile hImg, StrConv(sOut, vbUnicode), encoderCLSID, ByVal 0& End Function Public Sub EmfStreamToJpg(bEMF() As Byte, sSaveTo As String) Dim pStrm As oleexp3.IStream Dim hemf As Long Set pStrm = pvStreamFromArrayB(VarPtr(bEMF(0)), UBound(bEMF) + 1) Call GdipLoadImageFromStream(pStrm, hemf) If hemf Then Call gdipImgToFileJPG(hemf, sSaveTo) GdipDisposeImage hemf End If End Sub




Reply With Quote