コード例 #1
0
 /// <summary>
 /// A new collection of icons that can be embedded into an executable file.
 /// </summary>
 public IconDirectoryResource(IconFile iconFile)
     : base(Kernel32.ResourceTypes.RT_GROUP_ICON)
 {
     for (UInt16 id = 0; id < iconFile.Icons.Count; id++)
     {
         IconResource iconResource = new IconResource(
             iconFile.Icons[id], new ResourceId(id), _language);
         Icons.Add(iconResource);
     }
 }
コード例 #2
0
 /// <summary>
 /// A new collection of cursors that can be embedded into an executable file.
 /// </summary>
 public CursorDirectoryResource(IconFile iconFile)
     : base(Kernel32.ResourceTypes.RT_GROUP_CURSOR)
 {
     for (UInt16 id = 0; id < iconFile.Icons.Count; id++)
     {
         CursorResource cursorResource = new CursorResource(
             iconFile.Icons[id], new ResourceId(id), _language);
         // cursor structure abuses planes and bits per pixel for cursor data
         cursorResource.HotspotX = iconFile.Icons[id].Header.wPlanes;
         cursorResource.HotspotY = iconFile.Icons[id].Header.wBitsPerPixel;
         Icons.Add(cursorResource);
     }
 }