提取嵌入为资源的图像

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了提取嵌入为资源的图像相关的知识,希望对你有一定的参考价值。

Use this to extract an image embedded as a resource in your project. Call the function supplying the full path to the resource, for example:

Dim myImage as Bitmap = EmbeddedIcon("MyApplication1.myImage.png")

Where "MyApplication1" is the root namespace for the project.
  1. Imports System.Reflection.Assembly
  2.  
  3. 'returns an embedded resource image by name
  4. Public Function EmbeddedImage(ByVal Name As String) As Bitmap
  5. Return New Bitmap(GetExecutingAssembly.GetManifestResourceStream(Name))
  6. End Function

以上是关于提取嵌入为资源的图像的主要内容,如果未能解决你的问题,请参考以下文章