# TBMANLIB_RES Package

**Author:** woeoio. **Version:** 1.0.0.4

A twinBASIC package for loading binary resources embedded in a compiled executable and converting them to bytes, strings, hex, Base64, or pictures.

## Classes

- [cRes](/tB/Packages/Contributed/TBMANLIB_RES/cRes/index.md) -- loads a binary resource from the compiled executable and converts it to bytes, a string, hex, Base64, or a picture.

## Modules

- [GLOBAL_RES](/tB/Packages/Contributed/TBMANLIB_RES/GLOBAL_RES.md) -- exposes a pre-instantiated `cRes` object as a public variable, providing package-wide access to resource loading without requiring a separate instance.

## Enumerations

- [Base64Prefix](/tB/Packages/Contributed/TBMANLIB_RES/Base64Prefix.md) -- specifies whether, and with what MIME type, a data URI prefix is prepended to the Base64 string returned by `ReturnBase64`.

## Methods (cRes)

- [Read](/tB/Packages/Contributed/TBMANLIB_RES/cRes/Read.md) -- loads a resource from the compiled executable into the `cRes` instance.
- [ReturnBase64](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnBase64.md) -- returns the resource bytes as a Base64-encoded string, with an optional MIME-type data-URI prefix.
- [ReturnBytes](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnBytes.md) -- returns the raw byte array loaded from the resource file.
- [ReturnHex](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnHex.md) -- returns the loaded resource bytes as an uppercase hex string, with an optional separator between each byte and an optional line-break interval.
- [ReturnPicture](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnPicture.md) -- returns the loaded resource bytes as an `IPictureDisp` object.
- [ReturnString](/tB/Packages/Contributed/TBMANLIB_RES/cRes/ReturnString.md) -- returns the loaded resource bytes as a `String`, with an optional character-set conversion.

## Test cases

The notes and warnings of this section are checked by the test cases in [TBMANLIB_RES-tests.twinproj](TBMANLIB_RES-tests.twinproj), a twinBASIC project. It uses TBMANLIB_RES as a [linked package](/Features/Packages/Linked.md#manual-management): put the package's `.twinpack` in `%APPDATA%\twinBASIC\packages`, then run the project, and each case prints whether it passes.
