Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use VB.NET resource file LoadResData

Shulou Source: shulou.com Published: 2022-06-02 08:49:04 11月15日 Update

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!

Tags: Resources files characters strings cursors content icons fonts numeric values data more identifiers users articles good original practical bitmaps functions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia MariaDB Redmi Linux MySQL