private Bitmap GetStandardResourceBitmap(string source, string resourceId) { Bitmap result = null; if (source == "") source = Application.ExecutablePath; if (resourceId == "") resourceId = "ASMA"; using (ResourceLibrary library = new ResourceLibrary()) { library.Filename = source; IntPtr hDib = library.GetResource(resourceId, ResourceLibrary.ImageType.IMAGE_BITMAP, ResourceLibrary.ImageLoadOptions.LR_CREATEDIBSECTION); if (!hDib.Equals(IntPtr.Zero)) { result = ResourceLibrary.DibToBitmap(hDib); ResourceLibrary.DeleteObject(hDib); } } return result; }