コード例 #1
0
 internal static void getBitmap(ImageList.ImageCollection images, string bitmapName)
 {
     System.Drawing.Bitmap bitmap = getBitmap(bitmapName);
     images.Add(bitmapName, bitmap);
 }
コード例 #2
0
		/// <summary>
		/// Load default images for device tree.
		/// </summary>
		/// <param name="Images"></param>
		void LoadDefaultImages(ImageList.ImageCollection Images)
		{		
			System.Drawing.Bitmap bm = null;
			//Load device categories image
			System.IO.Stream stream = this.GetType().Assembly.GetManifestResourceStream("DLMS.Resources.DeviceCategories.bmp");
			if (stream != null)
			{
				bm = new System.Drawing.Bitmap(stream);
				bm.MakeTransparent();					
				Images.Add(bm);
			}

			//Load device category image
			stream = this.GetType().Assembly.GetManifestResourceStream("DLMS.Resources.DeviceCategory.bmp");
			if (stream != null)
			{
				bm = new System.Drawing.Bitmap(stream);
				bm.MakeTransparent(System.Drawing.Color.FromArgb(255, 0, 255));
				Images.Add(bm);
			}

			//Load device tables image
			stream = this.GetType().Assembly.GetManifestResourceStream("DLMS.Resources.DeviceTables.bmp");
			if (stream != null)
			{
				bm = new System.Drawing.Bitmap(stream);
				bm.MakeTransparent();					
				Images.Add(bm);
			}

			//Load device table image
			stream = this.GetType().Assembly.GetManifestResourceStream("DLMS.Resources.DeviceTable.bmp");
			if (stream != null)
			{
				bm = new System.Drawing.Bitmap(stream);
				bm.MakeTransparent();					
				Images.Add(bm);
			}

			//Load device properties image
			stream = this.GetType().Assembly.GetManifestResourceStream("DLMS.Resources.DeviceProperties.bmp");
			if (stream != null)
			{
				bm = new System.Drawing.Bitmap(stream);
				bm.MakeTransparent();					
				Images.Add(bm);
			}

			//Load device property image
			stream = this.GetType().Assembly.GetManifestResourceStream("DLMS.Resources.DeviceProperty.bmp");
			if (stream != null)
			{
				bm = new System.Drawing.Bitmap(stream);
				bm.MakeTransparent();					
				Images.Add(bm);
			}
			//Load None image
			stream = this.GetType().Assembly.GetManifestResourceStream("DLMS.Resources.DatabaseNone.bmp");
			if (stream != null)
			{
				bm = new System.Drawing.Bitmap(stream);
				bm.MakeTransparent();					
				Images.Add(bm);
			}
		}