Struct native_windows_gui::EmbedResource[][src]

pub struct EmbedResource {
    pub hinst: HINSTANCE,
}
Expand description

EmbedResource represent an embed resource file (“.rc”) inside on the executable module.

By default (without any arguments), the embed resources wraps the executable. If the embed resources are in a dll, it’s also possible to load them by setting the “module” parameter to the dll name.

Builder parameters: * module: The name of the module that owns the embed resources. If None, use the executable name.

use native_windows_gui as nwg;
fn build_embed1() -> nwg::EmbedResource {
    nwg::EmbedResource::load(None).unwrap()
}

fn build_embed2() -> nwg::EmbedResource {
    nwg::EmbedResource::load(Some("external.dll")).unwrap()
}

Fields

hinst: HINSTANCE

Implementations

Returns an embed resource that wraps the current executable. Shortcut for the builder API.

Creates a EmbedResourceBuilder. EmbedResource::load can also be used to skip the builder api

Load a string the the RC file STRINGTABLE. Returns None if id does not map to a string.

Load an icon from the rc file. Returns None if id does not map to a icon. For more feature, use the Icon::builder with the embed parameter.

Load an icon identified by a string in a resource file. Returns None if id does not map to a icon.

Load a bitmap file from the rc file. Returns None if id does not map to a bitmap.

Load a bitmap file from the rc file. Returns None if id does not map to a bitmap.

Load an image from the embed files and returns a bitmap. An image is defined this way: IMAGE_NAME IMAGE "../path/my_image.bmp" This method can load any image type supported by the image decoder.

Load a image using a string name. See EmbedResource::image

Load a cursor file from the rc file. Returns None if id does not map to a cursor.

Load a cursor file from the rc file. Returns None if id does not map to a cursor.

Return a wrapper over the data of an embed resource. Return None id does not map to a resource.

Return a wrapper over the data of an embed resource. Return None id does not map to a resource.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.