![](https://csdnimg.cn/release/download_crawler_static/20046847/bg4.jpg)
4. 切换至 Form1 的代码视图(右击 Form1,选择查看代码),将下面几行代
码添加到文件开始处:
1: using Leadtools;
2: using Leadtools.WinForms;
3: using Leadtools.Codecs;
4: using Leadtools.Codecs.Cmp;
5: using Leadtools.Codecs.Bmp;
6: using Leadtools.ImageProcessing;
7: using Leadtools.ImageProcessing.Core;
8: using Leadtools.ImageProcessing.Effects;
9: using Leadtools.ImageProcessing.SpecialEffects;
5. 将以下变量添加至 Form1 类:
1: private RasterImageViewer beforePic;
2: private RasterImageViewer afterPic;
3: private RasterCodecs codecs;
4: private RasterImage temp;
6. 添加 Form1 Load 事件句柄,在其中添加以下代码:
1: beforePic = new RasterImageViewer();
2: beforePic.BackColor = Color.DarkCyan;
3: beforePic.Dock = DockStyle.Fill;
4: beforePic.InteractiveMode = RasterViewerInteractiveMode.Pa
n;
5: beforePic.HorizontalAlignMode = RasterPaintAlignMode.Cente
r;
6: beforePic.VerticalAlignMode = RasterPaintAlignMode.Center;
7: beforePic.AutoResetScaleFactor = false;
8: panelBefore.Controls.Add(beforePic);
9: beforePic.BringToFront();
10:
11: afterPic = new RasterImageViewer();
12: afterPic.BackColor = beforePic.BackColor;
13: afterPic.Dock = beforePic.Dock;