Desktop Functions: Smart Device Functions:
|
LoadImage (user32)
C# Signature:
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] VB Signature:
<DllImport("user32.dll", SetLastError:=True)> _ C++/CLI Signature:
[DllImportAttribute("user32.dll", SetLastError = true, CharSet = CharSet::Auto)] User-Defined Types:None. User-Defined Constants:Notes:C++/CLI: This solution allows you to load an image from an unmanaged resource in the assembly. In my case I added a .cur file to my .rc. The cursor had an ID of 101. After loading the cursor I assigned it to the Forms::Cursor. Tips & Tricks:To use integer resource ID instead of string, and avoid using MAKEINTRESOURCE, prepend the integer with '#'. For example, to use resource ID 32512, enter "#32512" for lpszName. To load application icons of different sizes, use cxDesired and cyDesired (see the example). Sample Code:Please add some! C++/CLI Example
using namespace System::Runtime::InteropServices; Alternative Managed API:- or to load an image from a managed resource (dll): System.Drawing.Bitmap.FromResource Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|