Foxtable(狐表)用户栏目专家坐堂 → [求助]请问狐表是否可以读取调用DLL的图片


  共有4183人关注过本帖树形打印复制链接

主题:[求助]请问狐表是否可以读取调用DLL的图片

帅哥哟,离线,有人找我吗?
大红袍
  21楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/1/18 [只看该作者]

贴出你写的代码啊。

 回到顶部
帅哥哟,离线,有人找我吗?
vvfree
  22楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:446 积分:3414 威望:0 精华:0 注册:2015/3/4 15:55:00
回复:(大红袍)贴出你写的代码啊。  发帖心情 Post By:2016/1/18 1:17:00 [只看该作者]

这是获取BMP的 ICO的'Dim ico = Icon.FromHandle(.GetHicon) 不知道怎么用

 

Dim myAssembly = System.Reflection.Assembly.Load("resDll")     
Dim myManager = new  System.Resources.ResourceManager("resDll.Properties.Resources", myAssembly)
Dim myImage = myManager.GetObject("ww") 'HW.BMP

Dim imgp As WinForm.PictureBox = e.Form.Controls("PictureBox1")
imgp.Image = myImage


 回到顶部
帅哥哟,离线,有人找我吗?
Hyphen
  23楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/1/18 8:45:00 [只看该作者]

代码没有问题,取出来的就是Icon对象,只是不能直接赋值给 PictureBox,赋值这样处理

imgp.Image = Image.FromHbitmap(myImage.ToBitmap().GetHbitmap())

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  24楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/1/18 9:15:00 [只看该作者]

Dim myAssembly = System.Reflection.Assembly.Load("resDll")     
Dim myManager = new  System.Resources.ResourceManager("resDll.Properties.Resources", myAssembly)
Dim myImage = myManager.GetObject("ww") 'HW.BMP
msgbox(myimage.gettype.name)

 回到顶部
帅哥哟,离线,有人找我吗?
vvfree
  25楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:446 积分:3414 威望:0 精华:0 注册:2015/3/4 15:55:00
回复:(大红袍)Dim myAssembly = System.Reflection...  发帖心情 Post By:2016/1/18 13:11:00 [只看该作者]

ico图片背景不是透明的?怎么会有背景颜色?
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160118131047.png
图片点击可在新窗口打开查看

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  26楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/1/18 14:37:00 [只看该作者]

这样写,测试没问题

 

Dim myAssembly = System.Reflection.Assembly.Load("resDll")     
Dim myManager = new  System.Resources.ResourceManager("resDll.Properties.Resources", myAssembly)
Dim myImage = myManager.GetObject("ww") 'HW.BMP
e.Form.Controls("PictureBox2").image = myImage.ToBitmap()


 回到顶部
总数 26 上一页 1 2 3