initial drag and drop visual (shows there is a bug to figure out)
This commit is contained in:
parent
30a3d1e4b3
commit
1361a46b7c
@ -12,6 +12,7 @@ using System.IO;
|
||||
using System.Resources;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
|
||||
namespace SpriteLibrary
|
||||
@ -120,6 +121,30 @@ namespace SpriteLibrary
|
||||
private void UpdateChosenAreaLabel()
|
||||
{
|
||||
lblChosenArea.Text = ChosenArea.X + "," + ChosenArea.Y + "," + ChosenArea.Width + "," + ChosenArea.Height;
|
||||
UpdateHighlightBox();
|
||||
}
|
||||
|
||||
private void UpdateHighlightBox()
|
||||
{
|
||||
int transparency = 200;
|
||||
Image NewFrontImage = new Bitmap(pbImageField.BackgroundImage.Width, pbImageField.BackgroundImage.Height);
|
||||
Color FillColor = Color.Green;
|
||||
Brush brush = new SolidBrush(Color.FromArgb(transparency, FillColor.R, FillColor.G, FillColor.B));
|
||||
Brush nobrush = new SolidBrush(Color.FromArgb(0,0,0,0));
|
||||
using (Graphics G = Graphics.FromImage(NewFrontImage))
|
||||
{
|
||||
G.FillRectangle(brush, 0,0,NewFrontImage.Width,NewFrontImage.Height);
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddRectangle(ChosenArea);
|
||||
G.SetClip(path);
|
||||
G.Clear(Color.Transparent);
|
||||
G.ResetClip();
|
||||
// G.FillRectangle(nobrush, ChosenArea);
|
||||
|
||||
}
|
||||
pbImageField.Image = NewFrontImage;
|
||||
pbImageField.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||
pbImageField.Invalidate();
|
||||
}
|
||||
|
||||
private void SetUpEmptyInfo()
|
||||
|
Loading…
Reference in New Issue
Block a user