using PaintDotNet.SystemLayer; using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; namespace PaintDotNet.CustomControl { /// /// 画板底部的快捷栏 /// 非公共,每个DocumentWorkspace自己保持自己的 /// public class PanelBottom : ScrollPanel { /// /// 最佳 /// public MyFlatButton bestButton; /// /// 最大最小 /// public MyFlatButton maxMinButton; /// /// 原始状态 /// public MyFlatButton originButton; /// /// 伽马0.45 /// public MyFlatButton gamma45Button; /// /// 网格 /// public MyFlatButton gridButton; /// /// 辅助线 /// public MyFlatButton auxiliaryLineButton; /// /// 水平镜像 /// public MyFlatButton horizontalMirroringButton; /// /// 垂直镜像 /// public MyFlatButton verticalMirrorButton; /// /// 中心镜像 /// public MyFlatButton centerMirrorButton; /// /// 移动模式 /// public MyFlatButton mobileModeButton; /// /// 指针模式 /// public MyFlatButton cursorModeButton; /// /// 实际大小 /// public MyFlatButton actualSizeButton; /// /// 合适大小 /// public MyFlatButton zoomToWindowButton; /// /// 定倍显示 /// public MyFlatButton fixedTimesButton; /// /// 锁定扩缩 /// public MyFlatButton lockdownButton; /// /// 缩小按钮 /// public MyFlatButton zoomOutButton; /// /// 放大按钮 /// public MyFlatButton zoomInButton; /// /// 放大缩小的TrackBar /// public TrackBar trackBar; /// /// 放大缩小的百分比 /// public TextBox textBox; /// /// 另一个百分比,可能是比原始图片的倍数 /// public TextBox textBox1; /// /// 透明度的TrackBar /// //public TrackBar transparencyTrackBar; /// /// hint 提示信息 /// public ToolTip toolTip; /// /// 位置 /// public int locationX = 5; /// /// 左侧快捷工具的容器 /// private Panel panelLeft; /// /// 目前被改成tab的菜单了 /// public PanelBottomRight documentStrip; public PanelBottom() { InitializeComponent(); InitInternalControl(); this.documentStrip = new PanelBottomRight(); // // documentStrip // ////设置多图/多相模式,true为显示多图 //this.documentStrip.ShowPictures = true; ////设置单选模式 //this.documentStrip.documentStrip.AllowMultiChoise = false; this.documentStrip.AutoSize = false; this.documentStrip.Name = "PanelBottomRight"; this.documentStrip.TabIndex = 5; this.documentStrip.Location = new Point(0, 0); this.documentStrip.Size = new Size(400, 20); this.documentStrip.Dock = DockStyle.Right; this.documentStrip.ItemCheckChanged += new EventHandler>(this.ItemCheckChanged); this.Controls.Add(this.documentStrip); } /// /// 最佳 /// /// /// private void onMouseMoveBest(object sender, MouseEventArgs e) { //this.Focus(); if (!this.bestButton.selected) { this.bestButton.BackColor = Color.FromArgb(181, 215, 243); this.bestButton.FlatAppearance.BorderSize = 1; this.bestButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 最佳 /// /// /// private void onMouseLeaveBest(object sender, EventArgs e) { //this.Focus(); if (!this.bestButton.selected) { this.bestButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.bestButton.FlatAppearance.BorderSize = 0; this.bestButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 最大最小 /// /// /// private void onMouseMoveMaxMin(object sender, MouseEventArgs e) { //this.Focus(); if (!this.maxMinButton.selected) { this.maxMinButton.BackColor = Color.FromArgb(181, 215, 243); this.maxMinButton.FlatAppearance.BorderSize = 1; this.maxMinButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 最大最小 /// /// /// private void onMouseLeaveMaxMin(object sender, EventArgs e) { //this.Focus(); if (!this.maxMinButton.selected) { this.maxMinButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.maxMinButton.FlatAppearance.BorderSize = 0; this.maxMinButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 原始状态 /// /// /// private void onMouseMoveOrigin(object sender, MouseEventArgs e) { //this.Focus(); if (!this.originButton.selected) { this.originButton.BackColor = Color.FromArgb(181, 215, 243); this.originButton.FlatAppearance.BorderSize = 1; this.originButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 原始状态 /// /// /// private void onMouseLeaveOrigin(object sender, EventArgs e) { //this.Focus(); if (!this.originButton.selected) { this.originButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.originButton.FlatAppearance.BorderSize = 0; this.originButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 伽马0.45 /// /// /// private void onMouseMoveGamma45(object sender, MouseEventArgs e) { //this.Focus(); if (!this.gamma45Button.selected) { this.gamma45Button.BackColor = Color.FromArgb(181, 215, 243); this.gamma45Button.FlatAppearance.BorderSize = 1; this.gamma45Button.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 伽马0.45 /// /// /// private void onMouseLeaveGamma45(object sender, EventArgs e) { //this.Focus(); if (!this.gamma45Button.selected) { this.gamma45Button.BackColor = Color.FromArgb(0, 0, 0, 0); this.gamma45Button.FlatAppearance.BorderSize = 0; this.gamma45Button.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 网格 /// /// /// private void onMouseMoveGrid(object sender, MouseEventArgs e) { //this.Focus(); if (!this.gridButton.selected) { this.gridButton.BackColor = Color.FromArgb(181, 215, 243); this.gridButton.FlatAppearance.BorderSize = 1; this.gridButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } if (this.gridButton.Focused) this.gridButton.FlatAppearance.BorderSize = 1; } /// /// 网格 /// /// /// private void onMouseLeaveGrid(object sender, EventArgs e) { //this.Focus(); if (!this.gridButton.selected) { this.gridButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.gridButton.FlatAppearance.BorderSize = 0; this.gridButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 辅助线 /// /// /// private void onMouseMoveAuxiliaryLine(object sender, MouseEventArgs e) { //this.Focus(); if (!this.auxiliaryLineButton.selected) { this.auxiliaryLineButton.BackColor = Color.FromArgb(181, 215, 243); this.auxiliaryLineButton.FlatAppearance.BorderSize = 1; this.auxiliaryLineButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 辅助线 /// /// /// private void onMouseLeaveAuxiliaryLine(object sender, EventArgs e) { //this.Focus(); if (!this.auxiliaryLineButton.selected) { this.auxiliaryLineButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.auxiliaryLineButton.FlatAppearance.BorderSize = 0; this.auxiliaryLineButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 水平镜像 /// /// /// private void onMouseMoveHorizontalMirroring(object sender, MouseEventArgs e) { //this.Focus(); if (!this.horizontalMirroringButton.selected) { this.horizontalMirroringButton.BackColor = Color.FromArgb(181, 215, 243); this.horizontalMirroringButton.FlatAppearance.BorderSize = 1; this.horizontalMirroringButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 水平镜像 /// /// /// private void onMouseLeaveHorizontalMirroring(object sender, EventArgs e) { //this.Focus(); if (!this.horizontalMirroringButton.selected) { this.horizontalMirroringButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.horizontalMirroringButton.FlatAppearance.BorderSize = 0; this.horizontalMirroringButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 垂直镜像 /// /// /// private void onMouseMoveVerticalMirror(object sender, MouseEventArgs e) { //this.Focus(); if (!this.verticalMirrorButton.selected) { this.verticalMirrorButton.BackColor = Color.FromArgb(181, 215, 243); this.verticalMirrorButton.FlatAppearance.BorderSize = 1; this.verticalMirrorButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 垂直镜像 /// /// /// private void onMouseLeaveVerticalMirror(object sender, EventArgs e) { //this.Focus(); if (!this.verticalMirrorButton.selected) { this.verticalMirrorButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.verticalMirrorButton.FlatAppearance.BorderSize = 0; this.verticalMirrorButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 中心镜像 /// /// /// private void onMouseMoveCenterMirror(object sender, MouseEventArgs e) { //this.Focus(); if (!this.centerMirrorButton.selected) { this.centerMirrorButton.BackColor = Color.FromArgb(181, 215, 243); this.centerMirrorButton.FlatAppearance.BorderSize = 1; this.centerMirrorButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 中心镜像 /// /// /// private void onMouseLeaveCenterMirror(object sender, EventArgs e) { //this.Focus(); if (!this.centerMirrorButton.selected) { this.centerMirrorButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.centerMirrorButton.FlatAppearance.BorderSize = 0; this.centerMirrorButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 移动模式 /// /// /// private void onMouseMoveMobileMode(object sender, MouseEventArgs e) { //this.Focus(); if (!this.mobileModeButton.selected) { this.mobileModeButton.BackColor = Color.FromArgb(181, 215, 243); this.mobileModeButton.FlatAppearance.BorderSize = 1; this.mobileModeButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 移动模式 /// /// /// private void onMouseLeaveMobileMode(object sender, EventArgs e) { //this.Focus(); if (!this.mobileModeButton.selected) { this.mobileModeButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.mobileModeButton.FlatAppearance.BorderSize = 0; this.mobileModeButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 指针模式 /// /// /// private void onMouseMoveCursorMode(object sender, MouseEventArgs e) { //this.Focus(); if (!this.cursorModeButton.selected) { this.cursorModeButton.BackColor = Color.FromArgb(181, 215, 243); this.cursorModeButton.FlatAppearance.BorderSize = 1; this.cursorModeButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 指针模式 /// /// /// private void onMouseLeaveCursorMode(object sender, EventArgs e) { //this.Focus(); if (!this.cursorModeButton.selected) { this.cursorModeButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.cursorModeButton.FlatAppearance.BorderSize = 0; this.cursorModeButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 实际大小 /// /// /// private void onMouseMoveActualSize(object sender, MouseEventArgs e) { //this.Focus(); if (!this.actualSizeButton.selected) { this.actualSizeButton.BackColor = Color.FromArgb(181, 215, 243); this.actualSizeButton.FlatAppearance.BorderSize = 1; this.actualSizeButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 实际大小 /// /// /// private void onMouseLeaveActualSize(object sender, EventArgs e) { //this.Focus(); if (!this.actualSizeButton.selected) { this.actualSizeButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.actualSizeButton.FlatAppearance.BorderSize = 0; this.actualSizeButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 合适大小 /// /// /// private void onMouseMoveZoomToWindow(object sender, MouseEventArgs e) { //this.Focus(); if (!this.zoomToWindowButton.selected) { this.zoomToWindowButton.BackColor = Color.FromArgb(181, 215, 243); this.zoomToWindowButton.FlatAppearance.BorderSize = 1; this.zoomToWindowButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 合适大小 /// /// /// private void onMouseLeaveZoomToWindow(object sender, EventArgs e) { //this.Focus(); if (!this.zoomToWindowButton.selected) { this.zoomToWindowButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.zoomToWindowButton.FlatAppearance.BorderSize = 0; this.zoomToWindowButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 定倍显示 /// /// /// private void onMouseMoveFixedTimes(object sender, MouseEventArgs e) { //this.Focus(); if (!this.fixedTimesButton.selected) { this.fixedTimesButton.BackColor = Color.FromArgb(181, 215, 243); this.fixedTimesButton.FlatAppearance.BorderSize = 1; this.fixedTimesButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 定倍显示 /// /// /// private void onMouseLeaveFixedTimes(object sender, EventArgs e) { //this.Focus(); if (!this.fixedTimesButton.selected) { this.fixedTimesButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.fixedTimesButton.FlatAppearance.BorderSize = 0; this.fixedTimesButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 锁定扩缩 /// /// /// private void onMouseMoveLockdown(object sender, MouseEventArgs e) { //this.Focus(); if (!this.lockdownButton.selected) { this.lockdownButton.BackColor = Color.FromArgb(181, 215, 243); this.lockdownButton.FlatAppearance.BorderSize = 1; this.lockdownButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 锁定扩缩 /// /// /// private void onMouseLeaveLockdown(object sender, EventArgs e) { //this.Focus(); if (!this.lockdownButton.selected) { this.lockdownButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.lockdownButton.FlatAppearance.BorderSize = 0; this.lockdownButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 缩小按钮 /// /// /// private void onMouseMoveZoomOut(object sender, MouseEventArgs e) { //this.Focus(); if (!this.zoomOutButton.selected) { this.zoomOutButton.BackColor = Color.FromArgb(181, 215, 243); this.zoomOutButton.FlatAppearance.BorderSize = 1; this.zoomOutButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 缩小按钮 /// /// /// private void onMouseLeaveZoomOut(object sender, EventArgs e) { //this.Focus(); if (!this.zoomOutButton.selected) { this.zoomOutButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.zoomOutButton.FlatAppearance.BorderSize = 0; this.zoomOutButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 放大按钮 /// /// /// private void onMouseMoveZoomIn(object sender, MouseEventArgs e) { //this.Focus(); if (!this.zoomInButton.selected) { this.zoomInButton.BackColor = Color.FromArgb(181, 215, 243); this.zoomInButton.FlatAppearance.BorderSize = 1; this.zoomInButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); } } /// /// 放大按钮 /// /// /// private void onMouseLeaveZoomIn(object sender, EventArgs e) { //this.Focus(); if (!this.zoomInButton.selected) { this.zoomInButton.BackColor = Color.FromArgb(0, 0, 0, 0); this.zoomInButton.FlatAppearance.BorderSize = 0; this.zoomInButton.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0); } } /// /// 给DocumentView的事件,用于相的选中和取消 /// public event EventHandler> ItemICheckChanged; private void OnItemICheckChanged(int index) { if (ItemICheckChanged != null) { ItemICheckChanged(this, new EventArgs(index)); } } private void ItemCheckChanged(object sender, EventArgs e) { OnItemICheckChanged(e.Data); } /// /// 创建内部组件 /// private void InitInternalControl() { // // 设置Panel属性 // this.Cursor = Cursors.Default; // // 左侧panel属性 // this.panelLeft = new Panel(); this.panelLeft.Dock = DockStyle.Left; this.panelLeft.AutoSize = true; // // 最佳 // this.bestButton = new MyFlatButton(); this.bestButton.Location = new Point(locationX, 5); this.bestButton.Size = new Size(20, 20); this.bestButton.Image = PdnResources.GetImageResource("Icons.MenuViewBestIcon.png").Reference; this.bestButton.FlatStyle = FlatStyle.Flat; this.bestButton.FlatAppearance.BorderSize = 0; this.bestButton.MouseMove += new MouseEventHandler(onMouseMoveBest); this.bestButton.MouseLeave += new EventHandler(onMouseLeaveBest); // // 最大最小 // this.locationX += 30; this.maxMinButton = new MyFlatButton(); this.maxMinButton.Location = new Point(locationX, 5); this.maxMinButton.Size = new Size(20, 20); this.maxMinButton.Image = PdnResources.GetImageResource("Icons.MenuViewMaxMinIcon.png").Reference; this.maxMinButton.FlatStyle = FlatStyle.Flat; this.maxMinButton.FlatAppearance.BorderSize = 0; this.maxMinButton.MouseMove += new MouseEventHandler(onMouseMoveMaxMin); this.maxMinButton.MouseLeave += new EventHandler(onMouseLeaveMaxMin); // // 原始状态 // this.locationX += 30; this.originButton = new MyFlatButton(); this.originButton.Location = new Point(locationX, 5); this.originButton.Size = new Size(20, 20); this.originButton.Image = PdnResources.GetImageResource("Icons.MenuViewOriginIcon.png").Reference; this.originButton.FlatStyle = FlatStyle.Flat; this.originButton.FlatAppearance.BorderSize = 0; this.originButton.MouseMove += new MouseEventHandler(onMouseMoveOrigin); this.originButton.MouseLeave += new EventHandler(onMouseLeaveOrigin); // // gamma0.45 // this.locationX += 30; this.gamma45Button = new MyFlatButton(); this.gamma45Button.Location = new Point(locationX, 5); this.gamma45Button.Size = new Size(20, 20); this.gamma45Button.Image = PdnResources.GetImageResource("Icons.MenuViewGamma45Icon.png").Reference; this.gamma45Button.FlatStyle = FlatStyle.Flat; this.gamma45Button.FlatAppearance.BorderSize = 0; this.gamma45Button.MouseMove += new MouseEventHandler(onMouseMoveGamma45); this.gamma45Button.MouseLeave += new EventHandler(onMouseLeaveGamma45); // // 网格 // this.locationX += 30; this.gridButton = new MyFlatButton(); this.gridButton.Location = new Point(locationX, 5); this.gridButton.Size = new Size(20, 20); this.gridButton.Image = PdnResources.GetImageResource("Icons.MenuToolsGridLineIcon.png").Reference; this.gridButton.FlatStyle = FlatStyle.Flat; this.gridButton.FlatAppearance.BorderSize = 0; this.gridButton.MouseMove += new MouseEventHandler(onMouseMoveGrid); this.gridButton.MouseLeave += new EventHandler(onMouseLeaveGrid); // // 辅助线 // this.locationX += 30; this.auxiliaryLineButton = new MyFlatButton(); this.auxiliaryLineButton.Location = new Point(locationX, 5); this.auxiliaryLineButton.Size = new Size(20, 20); this.auxiliaryLineButton.Image = PdnResources.GetImageResource("Icons.MenuToolsAuxiliaryLineIcon.png").Reference; this.auxiliaryLineButton.FlatStyle = FlatStyle.Flat; this.auxiliaryLineButton.FlatAppearance.BorderSize = 0; this.auxiliaryLineButton.MouseMove += new MouseEventHandler(onMouseMoveAuxiliaryLine); this.auxiliaryLineButton.MouseLeave += new EventHandler(onMouseLeaveAuxiliaryLine); // // 水平镜像 // this.locationX += 30; this.horizontalMirroringButton = new MyFlatButton(); this.horizontalMirroringButton.Location = new Point(locationX, 5); this.horizontalMirroringButton.Size = new Size(20, 20); this.horizontalMirroringButton.Image = PdnResources.GetImageResource("Icons.MenuImageFlipHorizontalIcon.png").Reference; this.horizontalMirroringButton.FlatStyle = FlatStyle.Flat; this.horizontalMirroringButton.FlatAppearance.BorderSize = 0; this.horizontalMirroringButton.MouseMove += new MouseEventHandler(onMouseMoveHorizontalMirroring); this.horizontalMirroringButton.MouseLeave += new EventHandler(onMouseLeaveHorizontalMirroring); // // 垂直镜像 // this.locationX += 30; this.verticalMirrorButton = new MyFlatButton(); this.verticalMirrorButton.Location = new Point(locationX, 5); this.verticalMirrorButton.Size = new Size(20, 20); this.verticalMirrorButton.Image = PdnResources.GetImageResource("Icons.MenuImageFlipVerticalIcon.png").Reference; this.verticalMirrorButton.FlatStyle = FlatStyle.Flat; this.verticalMirrorButton.FlatAppearance.BorderSize = 0; this.verticalMirrorButton.MouseMove += new MouseEventHandler(onMouseMoveVerticalMirror); this.verticalMirrorButton.MouseLeave += new EventHandler(onMouseLeaveVerticalMirror); // // 中心镜像 // this.locationX += 30; this.centerMirrorButton = new MyFlatButton(); this.centerMirrorButton.Location = new Point(locationX, 5); this.centerMirrorButton.Size = new Size(20, 20); this.centerMirrorButton.Image = PdnResources.GetImageResource("Icons.MenuImageFlipCenterIcon.png").Reference; this.centerMirrorButton.FlatStyle = FlatStyle.Flat; this.centerMirrorButton.FlatAppearance.BorderSize = 0; this.centerMirrorButton.MouseMove += new MouseEventHandler(onMouseMoveCenterMirror); this.centerMirrorButton.MouseLeave += new EventHandler(onMouseLeaveCenterMirror); // // 移动模式 // this.locationX += 30; this.mobileModeButton = new MyFlatButton(); this.mobileModeButton.Location = new Point(locationX, 5); this.mobileModeButton.Size = new Size(20, 20); this.mobileModeButton.Image = PdnResources.GetImageResource("Icons.PanToolIcon.png").Reference; this.mobileModeButton.FlatStyle = FlatStyle.Flat; this.mobileModeButton.FlatAppearance.BorderSize = 0; this.mobileModeButton.MouseMove += new MouseEventHandler(onMouseMoveMobileMode); this.mobileModeButton.MouseLeave += new EventHandler(onMouseLeaveMobileMode); // // 移动模式 // this.locationX += 30; this.cursorModeButton = new MyFlatButton(); this.cursorModeButton.Location = new Point(locationX, 5); this.cursorModeButton.Size = new Size(20, 20); this.cursorModeButton.Image = PdnResources.GetImageResource("Icons.MenuChoiseActionIcon.png").Reference; this.cursorModeButton.FlatStyle = FlatStyle.Flat; this.cursorModeButton.BackColor = Color.FromArgb(181, 215, 243); this.cursorModeButton.FlatAppearance.BorderSize = 1; this.cursorModeButton.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215); this.cursorModeButton.selected = true; this.cursorModeButton.MouseMove += new MouseEventHandler(onMouseMoveCursorMode); this.cursorModeButton.MouseLeave += new EventHandler(onMouseLeaveCursorMode); // // 实际大小 // this.locationX += 30; this.actualSizeButton = new MyFlatButton(); this.actualSizeButton.Location = new Point(locationX, 5); this.actualSizeButton.Size = new Size(20, 20); this.actualSizeButton.Image = PdnResources.GetImageResource("Icons.MenuViewActualSizeIcon.png").Reference; this.actualSizeButton.FlatStyle = FlatStyle.Flat; this.actualSizeButton.FlatAppearance.BorderSize = 0; this.actualSizeButton.MouseMove += new MouseEventHandler(onMouseMoveActualSize); this.actualSizeButton.MouseLeave += new EventHandler(onMouseLeaveActualSize); // // 合适大小 // this.locationX += 30; this.zoomToWindowButton = new MyFlatButton(); this.zoomToWindowButton.Location = new Point(locationX, 5); this.zoomToWindowButton.Size = new Size(20, 20); this.zoomToWindowButton.Image = PdnResources.GetImageResource("Icons.MenuViewZoomToWindowIcon.png").Reference; this.zoomToWindowButton.FlatStyle = FlatStyle.Flat; this.zoomToWindowButton.FlatAppearance.BorderSize = 0; this.zoomToWindowButton.MouseMove += new MouseEventHandler(onMouseMoveZoomToWindow); this.zoomToWindowButton.MouseLeave += new EventHandler(onMouseLeaveZoomToWindow); // // 定倍显示 // /*this.locationX += 20; this.fixedTimesButton = new MyFlatButton(); this.fixedTimesButton.Location = new Point(locationX, 5); this.fixedTimesButton.Size = new Size(20, 20); this.fixedTimesButton.Image = PdnResources.GetImageResource("Icons.MenuFixedMultipleIcon.png").Reference; this.fixedTimesButton.FlatStyle = FlatStyle.Flat; this.fixedTimesButton.FlatAppearance.BorderSize = 0;*/ // // 锁定扩缩 // this.locationX += 30; this.lockdownButton = new MyFlatButton(); this.lockdownButton.Location = new Point(locationX, 5); this.lockdownButton.Size = new Size(20, 20); this.lockdownButton.Image = PdnResources.GetImageResource("Icons.MenuLockZoomIcon.png").Reference; this.lockdownButton.FlatStyle = FlatStyle.Flat; this.lockdownButton.FlatAppearance.BorderSize = 0; this.lockdownButton.MouseMove += new MouseEventHandler(onMouseMoveLockdown); this.lockdownButton.MouseLeave += new EventHandler(onMouseLeaveLockdown); // // 缩小按钮 // this.locationX += 30; this.zoomOutButton = new MyFlatButton(); this.zoomOutButton.Location = new Point(locationX, 5); this.zoomOutButton.Size = new Size(20, 20); this.zoomOutButton.Image = PdnResources.GetImageResource("Icons.MenuViewZoomOutIcon.png").Reference; this.zoomOutButton.FlatStyle = FlatStyle.Flat; this.zoomOutButton.FlatAppearance.BorderSize = 0; this.zoomOutButton.MouseMove += new MouseEventHandler(onMouseMoveZoomOut); this.zoomOutButton.MouseLeave += new EventHandler(onMouseLeaveZoomOut); // // 放大按钮 // this.locationX += 30; this.zoomInButton = new MyFlatButton(); this.zoomInButton.Location = new Point(locationX, 5); this.zoomInButton.Size = new Size(20, 20); this.zoomInButton.Image = PdnResources.GetImageResource("Icons.MenuViewZoomInIcon.png").Reference; this.zoomInButton.FlatStyle = FlatStyle.Flat; this.zoomInButton.FlatAppearance.BorderSize = 0; this.zoomInButton.MouseMove += new MouseEventHandler(onMouseMoveZoomIn); this.zoomInButton.MouseLeave += new EventHandler(onMouseLeaveZoomIn); // // 放大缩小的TrackBar // this.locationX += 30; this.trackBar = new TrackBar(); this.trackBar.AutoSize = false; this.trackBar.Minimum = 1; this.trackBar.Name = "amountTrackBar"; this.trackBar.Location = new Point(locationX, 5); this.trackBar.Size = new Size(175, 20); this.trackBar.SmallChange = 1; this.trackBar.TickStyle = TickStyle.None; //this.trackBar.Value = 100; // // 放大缩小的百分比 // this.locationX += 175; this.textBox = new TextBox(); this.textBox.Size = new Size(40, 20); this.textBox.Location = new Point(locationX, 5); // // 另一个百分比,可能是定倍的倍数? // this.locationX += 40 + 5; this.textBox1 = new TextBox(); this.textBox1.Size = new Size(40, 20); this.textBox1.Location = new Point(locationX, 5); this.locationX += 40; //this.transparencyTrackBar = new TrackBar(); //this.transparencyTrackBar.AutoSize = false; //this.transparencyTrackBar.Minimum = 0; //this.transparencyTrackBar.Maximum = 255; //this.transparencyTrackBar.Name = "transparencyTrackBar"; //this.transparencyTrackBar.Location = new Point(locationX, 5); //this.transparencyTrackBar.Size = new Size(175, 20); //this.transparencyTrackBar.SmallChange = 1; //this.transparencyTrackBar.TickStyle = TickStyle.None; this.locationX += 40;// + 5 + 5; // // 提示信息 // this.toolTip = new ToolTip(); this.toolTip.SetToolTip(this.bestButton, PdnResources.GetString("Menu.optimal.text")); this.toolTip.SetToolTip(this.maxMinButton, PdnResources.GetString("Menu.max.text")+"/"+ PdnResources.GetString("Menu.minimum.text")); this.toolTip.SetToolTip(this.originButton, PdnResources.GetString("Menu.Originalstate.text")); this.toolTip.SetToolTip(this.gamma45Button, PdnResources.GetString("Menu.imagecapture.Previewwindow.Gamma.text")+"0.45"); this.toolTip.SetToolTip(this.gridButton, PdnResources.GetString("Menu.Tools.GridLine.Text")); this.toolTip.SetToolTip(this.auxiliaryLineButton, PdnResources.GetString("Menu.Tools.AuxiliaryLine.Text")); this.toolTip.SetToolTip(this.horizontalMirroringButton, PdnResources.GetString("Menu.Thelevelofthemirror.text")); this.toolTip.SetToolTip(this.verticalMirrorButton, PdnResources.GetString("Menu.Verticalmirror.text")); this.toolTip.SetToolTip(this.centerMirrorButton, PdnResources.GetString("Menu.Centerfthemirror.text")); this.toolTip.SetToolTip(this.actualSizeButton, PdnResources.GetString("Menu.Edit.ActualSize.Text")); this.toolTip.SetToolTip(this.zoomToWindowButton, PdnResources.GetString("Menu.Edit.ZoomToWindow.Text")); //this.toolTip.SetToolTip(this.fixedTimesButton, PdnResources.GetString("Menu.Edit.FixedMultiple.Text")); this.toolTip.SetToolTip(this.lockdownButton, PdnResources.GetString("Menu.Edit.LockZoom.Text")); this.toolTip.SetToolTip(this.mobileModeButton, PdnResources.GetString("Menu.Mobilemodel.text")); this.toolTip.SetToolTip(this.cursorModeButton, PdnResources.GetString("Menu.Pointertothemodel.text")); this.toolTip.SetToolTip(this.zoomOutButton, PdnResources.GetString("CommonAction.ZoomOut")); this.toolTip.SetToolTip(this.zoomInButton, PdnResources.GetString("CommonAction.ZoomIn")); this.toolTip.ShowAlways = true; this.panelLeft.Controls.Add(this.bestButton); this.panelLeft.Controls.Add(this.maxMinButton); this.panelLeft.Controls.Add(this.originButton); this.panelLeft.Controls.Add(this.gamma45Button); this.panelLeft.Controls.Add(this.gridButton); this.panelLeft.Controls.Add(this.auxiliaryLineButton); this.panelLeft.Controls.Add(this.horizontalMirroringButton); this.panelLeft.Controls.Add(this.verticalMirrorButton); this.panelLeft.Controls.Add(this.centerMirrorButton); this.panelLeft.Controls.Add(this.actualSizeButton); this.panelLeft.Controls.Add(this.zoomToWindowButton); this.panelLeft.Controls.Add(this.fixedTimesButton); this.panelLeft.Controls.Add(this.lockdownButton); this.panelLeft.Controls.Add(this.mobileModeButton); this.panelLeft.Controls.Add(this.cursorModeButton); this.panelLeft.Controls.Add(this.zoomOutButton); this.panelLeft.Controls.Add(this.zoomInButton); this.panelLeft.Controls.Add(this.trackBar); this.panelLeft.Controls.Add(this.textBox); //this.panelLeft.Controls.Add(this.textBox1); //this.panelLeft.Controls.Add(this.transparencyTrackBar); this.Controls.Add(this.panelLeft); } #region 设计器 /// /// 必需的设计器变量。 /// private System.ComponentModel.IContainer components = null; /// /// 清理所有正在使用的资源。 /// /// 如果应释放托管资源,为 true;否则为 false。 protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region 组件设计器生成的代码 /// /// 设计器支持所需的方法 - 不要修改 /// 使用代码编辑器修改此方法的内容。 /// private void InitializeComponent() { components = new System.ComponentModel.Container(); } #endregion #endregion } }