Files
2025-10-09 09:57:24 +09:00

107 lines
2.7 KiB
C#

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using AForge.Imaging.Filters;
namespace VideoReader;
public class Form2 : Form
{
private string nam;
private IContainer components;
public UCPictureBox RealTime;
public Form2()
{
InitializeComponent();
nam = ((Control)this).Text;
}
private void RealTime_KeyDown(object sender, KeyEventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Invalid comparison between Unknown and I4
if ((int)e.KeyCode == 118)
{
((Control)this).Visible = false;
}
}
public void ShowVideo(Bitmap img, int br, int co)
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
try
{
if (img != null)
{
Bitmap val = new Bitmap((Image)(object)img);
img = val;
_ = RealTime.Image;
if (br != 0)
{
new BrightnessCorrection(br).ApplyInPlace(img);
}
if (co != 0)
{
new ContrastCorrection(co).ApplyInPlace(img);
}
((Control)RealTime).Invoke((Delegate)(Action)delegate
{
RealTime.Image = (Image)(object)img;
((Control)RealTime).Refresh();
});
}
}
catch (Exception)
{
}
}
private void RealTime_DoubleClick(object sender, EventArgs e)
{
((Form)this).TopMost = !((Form)this).TopMost;
((Control)this).Text = (((Form)this).TopMost ? "! " : "") + nam;
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
((Form)this).Dispose(disposing);
}
private void InitializeComponent()
{
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Expected O, but got Unknown
RealTime = new UCPictureBox();
((Control)this).SuspendLayout();
((Control)RealTime).Dock = (DockStyle)5;
RealTime.Flip = 0;
RealTime.Image = null;
((Control)RealTime).Location = new Point(0, 0);
((Control)RealTime).Name = "RealTime";
RealTime.Rotate = 0;
((Control)RealTime).Size = new Size(800, 450);
RealTime.SizeImage = new Size(1280, 720);
((Control)RealTime).TabIndex = 0;
((Control)RealTime).DoubleClick += RealTime_DoubleClick;
((Control)RealTime).KeyDown += new KeyEventHandler(RealTime_KeyDown);
((ContainerControl)this).AutoScaleDimensions = new SizeF(6f, 13f);
((ContainerControl)this).AutoScaleMode = (AutoScaleMode)1;
((Form)this).ClientSize = new Size(800, 450);
((Control)this).Controls.Add((Control)(object)RealTime);
((Form)this).MinimizeBox = false;
((Control)this).Name = "Form2";
((Form)this).ShowIcon = false;
((Control)this).Text = "VideoReader";
((Control)this).ResumeLayout(false);
}
}