Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use VB.NET resource file LoadResData

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about how to use the VB.NET resource file LoadResData. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

VB.NET resource file syntax:

LoadResData (index, format)

The usage of VB.NET resource file LoadResData

Partial description

Required for index. An integer or string that specifies the identifier (ID) of the data in the resource file. The icon reserved for the application with a resource with an ID identifier of 1.

Required for Format. A numeric value that specifies the original format of the returned data as described in the following "set value". This value can also be the string name of a user-defined resource.

VB.NET resource file setting values. The setting values for format are:

Setting description

1 cursor resources

2 bitmap resources

3 Icon Resources

4 menu resources

5 dialog box

6 string resources

7 Font directory resources

8 Font resources

9 acceleration key table

10 user-defined resources

12 group cursor

14 group icon

Oh, I just saw a function on the Internet, and the problem is solved.

Public Function SaveFileFromRes (vntResourceID As Variant, sType As String, sFileName As String) As Boolean Dim bytImage () As Byte 'Always store binary data in byte arrays! Dim iFileNum As Integer 'FreeFile Handle On Error GoTo SaveFileFromRes_Err SaveFileFromRes = True' Load Binary Data from Resource file bytImage = LoadResData (vntResourceID, sType) 'Get FreeFile Handle iFileNum = FreeFile' Open the file and save the data Open sFileName For Binary As iFileNum Put # iFileNum, bytImage Close iFileNum Exit Function SaveFileFromRes_Err: SaveFileFromRes = False: Exit Function End Function Thank you for reading! This is the end of the article on "how to use the VB.NET resource file LoadResData". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report