Пример #1
0
        public static void InitializeFromBitmap(IDataObject dataObject, Bitmap image, Point offset)
        {
            var hbmp = image.GetHbitmap();

            var shdi = new ShDragImage
            {
                sizeDragImage = image.Size,
                ptOffset = offset,
                crColorKey = Color.Magenta.ToArgb(),
                hbmpDragImage = hbmp
            };

            try
            {
                var ds = (IDragSourceHelper2)s_helper;
                ds.InitializeFromBitmap(ref shdi, dataObject);
            }
            catch
            {
                DeleteObject(hbmp);
            }
        }
Пример #2
0
        public static void InitializeFromBitmap(IDataObject dataObject, Bitmap image, Point offset)
        {
            var hbmp = image.GetHbitmap();

            var shdi = new ShDragImage
            {
                sizeDragImage = image.Size,
                ptOffset      = offset,
                crColorKey    = Color.Magenta.ToArgb(),
                hbmpDragImage = hbmp
            };

            try
            {
                var ds = (IDragSourceHelper2)s_helper;
                ds.InitializeFromBitmap(ref shdi, dataObject);
            }
            catch
            {
                DeleteObject(hbmp);
            }
        }