60 lines
1.5 KiB
C#
60 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using Hawkeye.VisionBuilder.Panels;
|
|
using Hawkeye.VisionBuilder.Workflow.Datatypes;
|
|
using Hawkeye.VisionBuilder.Workflow.Datatypes.Elements;
|
|
|
|
namespace Hawkeye.VisionBuilder.Features.ImagePreview
|
|
{
|
|
public partial class ImagePreviewPanel : BasePannel
|
|
{
|
|
public ImagePreviewPanel()
|
|
{
|
|
InitializeComponent();
|
|
imagePreviewControl = new ImagePreviewControl()
|
|
{
|
|
Dock = DockStyle.Fill
|
|
};
|
|
this.Controls.Add(imagePreviewControl);
|
|
imagePreviewControl.BringToFront();
|
|
}
|
|
|
|
public Workflow.Datatypes.HawkeyeImage CurrentImage { get; set; }
|
|
public void SetImage(Workflow.Datatypes.HawkeyeImage image)
|
|
{
|
|
if (image == null) return;
|
|
imagePreviewControl.Image = image;
|
|
CurrentImage = image;
|
|
imagePreviewControl.Invalidate();
|
|
}
|
|
|
|
public void ClearGraphics()
|
|
{
|
|
imagePreviewControl.GraphicsElements.Clear();
|
|
}
|
|
|
|
|
|
public void AddGraphics(IGraphicsElement element)
|
|
{
|
|
imagePreviewControl.GraphicsElements.Add(element);
|
|
}
|
|
|
|
public void Fit()
|
|
{
|
|
imagePreviewControl.FitToScreen();
|
|
}
|
|
|
|
private void btnFit_Click(object sender, EventArgs e)
|
|
{
|
|
Fit();
|
|
}
|
|
}
|
|
}
|