我目前有一个System.Drawing.Bitmap,我需要将它转换成一个stdole.StdPicture。目前我正在使用:
var pic = (stdole.StdPicture)Microsoft.VisualBasic.Compatibility.VB6.Support.ImageToIPicture
中构建一个由多个项目组成的解决方案,但是其中一个项目在编译它时给了我一个奇怪的错误:System.IO.FileLoadException - API restriction: The assembly 'file起初,我想我需要删除这个stdole.dll引用,所以我删除了它。但是,删除它之后,我将得到以下错误:
无法找到类
我有一个vbPicTypeIcon类型的stdole.StdPicture对象。我需要将它转换为vbPicTypeBitmap类型。由于项目的限制,我需要能够使用Win32或VBA来做到这一点。OleCreatePictureIndirect Lib "olepro32.dll" (lpPictDesc As PICTDESC, riid As Any, ByVal fOwn As Long, ipic As stdole.IPictureDispDim lngAppInstc As Long
Dim strFilePath As
Verarbeite COM-Verweis "" aus Pfad "C:\Windows\System32\stdole2.tlb".Verarbeite COM-Verweis "" aus Pfad "C:\Windows\System32\stdole2.tlb".翻译:
Processing COM reference "" from path "C:\Windows\System32\stdole2.tlb"
接下来,我必须使用stdole库来为第三方控件提供一些图像。\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll' because of an indirect reference to that assembly created by很简单,我将遵循这个建议,并为stdole引用将Embed类型设置为false。所以,我想这是不可能的(虽然我不知道为什么删除stdole上的嵌入互操作会使库完全找不到)。
那么,让我们走另一条路,用Embed true标记所有内容。糟了!现在,我已经通
ImageToPictureDispConverter = Nothing Dim objIPictureDisp As stdole.IPictureDispEnd Sub
Public Function GetIPictureDispFromImage(ByVal objImage As System.Drawing.Image) As stdole.IPictureDispDim objPicture As stdol