init commit
This commit is contained in:
106
output_3234/VideoReader/Form2.cs
Normal file
106
output_3234/VideoReader/Form2.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user