コード例 #1
0
        private VirtualEditData SetDataToImage(VirtualEditData lastData, VirtualLightType lightType, BitmapImage img)
        {
            VirtualEditData data = null;
            if (lastData == null)
            {
                data = new VirtualEditData();
            }
            else
            {
                data = lastData;
            }
            data.LightType = lightType;
            data.ImageDisplay = img;

            return data;
        }
コード例 #2
0
        private static void OnLightDragEvent(object sender, DragEventArgs e)
        {
            Image exImg = (Image)sender;
            if (!IsExchangedImage(exImg))
            {
                return;
            }

            IDataObject data = e.Data;
            Image img = data.GetData(typeof(Image)) as Image;


            VirtualEditData first = (VirtualEditData)img.DataContext;
            VirtualEditData second = (VirtualEditData)exImg.DataContext;
            VirtualEditData temp = new VirtualEditData();
            first.CopyTo(temp);
            second.CopyTo(first);
            temp.CopyTo(second);
        }