Example #1
0
        public IPicture ProduceNewTransparentPicture(
			System.Drawing.Image image,
			System.Drawing.Color transparentColor
		)
        {
            Picture picture = new Picture(image);
            picture.Transparent = true;
            picture.TransparentColor = transparentColor;
            return picture;
        }
Example #2
0
 public IPicture ProduceNewPicture(System.Drawing.Image image)
 {
     IPicture picture = new Picture(image);
     return picture;
 }
Example #3
0
        private void DrawImageTransparent(Picture pict, Point p)
        {
            IntPtr hPictureDC = API.CreateCompatibleDC(hDC);
            IntPtr hOldBitmap = API.SelectObject(hPictureDC, pict.hBitmap);

            API.TransparentBlt(
                hDC,
                p.X,
                p.Y,
                pict.Size.X,
                pict.Size.Y,
                hPictureDC,
                0,
                0,
                pict.Size.X,
                pict.Size.Y,
                pict.Win32TransparentColor
            );

            API.SelectObject(hPictureDC, hOldBitmap);
            API.DeleteDC(hPictureDC);
        }