using PaintDotNet.SystemLayer; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace PaintDotNet.ImageCollect.CameraPreviewComponent { internal class BaseActionsStrip : ToolStripEx { /// /// 十字线按钮 /// public ToolStripButton crossButton; /// /// 网格按钮 /// public ToolStripButton gridButton; /// /// 方形按钮 /// public ToolStripButton squareButton; /// /// 圆形按钮 /// public ToolStripButton roundButton; /// /// 实际大小按钮 /// public ToolStripButton actualSizeButton; /// /// 合适大小按钮 /// public ToolStripButton zoomToWindowButton; /// /// 全屏显示按钮 /// public ToolStripButton fullScreenButton; /// /// 缩小按钮 /// public ToolStripButton zoomOutButton; /// /// 放大按钮 /// public ToolStripButton zoomInButton; public BaseActionsStrip() { InitializeComponent(); this.crossButton.Image = PdnResources.GetImageResource("Icons.MenuPreviewCrossIcon.png").Reference; this.crossButton.ToolTipText = PdnResources.GetString("Menu.imagecapture.Previewwindow.reticle.text"); this.crossButton.Text = PdnResources.GetString("Menu.imagecapture.Previewwindow.reticle.text"); this.crossButton.TextImageRelation = TextImageRelation.ImageAboveText; this.gridButton.Image = PdnResources.GetImageResource("Icons.MenuViewGridIcon.png").Reference; this.gridButton.ToolTipText = PdnResources.GetString("Menu.Tools.GridLine.Text"); this.gridButton.Text = PdnResources.GetString("Menu.Tools.GridLine.Text"); this.gridButton.TextImageRelation = TextImageRelation.ImageAboveText; this.squareButton.Image = PdnResources.GetImageResource("Icons.RectangleSelectToolIcon.png").Reference; this.squareButton.ToolTipText = PdnResources.GetString("Menu.Square.text"); this.squareButton.Text = PdnResources.GetString("Menu.Square.text"); this.squareButton.TextImageRelation = TextImageRelation.ImageAboveText; this.roundButton.Image = PdnResources.GetImageResource("Icons.MenuPreviewCircleIcon.png").Reference; this.roundButton.ToolTipText = PdnResources.GetString("Menu.circular.Text"); this.roundButton.Text = PdnResources.GetString("Menu.circular.Text"); this.roundButton.TextImageRelation = TextImageRelation.ImageAboveText; this.actualSizeButton.Image = PdnResources.GetImageResource("Icons.MenuViewActualSizeIcon.png").Reference; this.actualSizeButton.ToolTipText = PdnResources.GetString("Menu.Edit.ActualSize.Text"); this.actualSizeButton.Text = PdnResources.GetString("Menu.Edit.ActualSize.Text"); this.actualSizeButton.TextImageRelation = TextImageRelation.ImageAboveText; this.zoomToWindowButton.Image = PdnResources.GetImageResource("Icons.MenuViewZoomToWindowIcon.png").Reference; this.zoomToWindowButton.ToolTipText = PdnResources.GetString("Menu.Edit.ZoomToWindow.Text"); this.zoomToWindowButton.Text = PdnResources.GetString("Menu.Edit.ZoomToWindow.Text"); this.zoomToWindowButton.TextImageRelation = TextImageRelation.ImageAboveText; this.fullScreenButton.Image = PdnResources.GetImageResource("Icons.MenuViewZoomToSelectionIcon.png").Reference; this.fullScreenButton.ToolTipText = PdnResources.GetString("Menu.imagecapture.Previewwindow.fullscreen.text"); this.fullScreenButton.Text = PdnResources.GetString("Menu.imagecapture.Previewwindow.fullscreen.text"); this.fullScreenButton.TextImageRelation = TextImageRelation.ImageAboveText; this.zoomOutButton.Image = PdnResources.GetImageResource("Icons.MenuViewZoomOutIcon.png").Reference; this.zoomOutButton.ToolTipText = PdnResources.GetString("CommonAction.ZoomOut"); this.zoomOutButton.Text = PdnResources.GetString("CommonAction.ZoomOut"); this.zoomOutButton.TextImageRelation = TextImageRelation.ImageAboveText; this.zoomInButton.Image = PdnResources.GetImageResource("Icons.MenuViewZoomInIcon.png").Reference; this.zoomInButton.ToolTipText = PdnResources.GetString("CommonAction.ZoomIn"); this.zoomInButton.Text = PdnResources.GetString("Menu.Edit.ZoomIn.Text"); this.zoomInButton.TextImageRelation = TextImageRelation.ImageAboveText; } /// /// 实例化基础按钮 /// private void InitializeComponent() { this.crossButton = new ToolStripButton(); this.gridButton = new ToolStripButton(); this.squareButton = new ToolStripButton(); this.roundButton = new ToolStripButton(); this.actualSizeButton = new ToolStripButton(); this.zoomToWindowButton = new ToolStripButton(); this.fullScreenButton = new ToolStripButton(); this.zoomOutButton = new ToolStripButton(); this.zoomInButton = new ToolStripButton(); this.SuspendLayout(); this.Items.Add(this.crossButton); this.Items.Add(this.gridButton); this.Items.Add(this.squareButton); this.Items.Add(this.roundButton); this.Items.Add(this.actualSizeButton); this.Items.Add(this.zoomToWindowButton); this.Items.Add(this.fullScreenButton); this.Items.Add(this.zoomOutButton); this.Items.Add(this.zoomInButton); this.ResumeLayout(false); } } }