/// <summary> /// Initializes a new instance of the <see cref="BarcodeWriterTool"/> class. /// </summary> public BarcodeWriterTool() { #if !REMOVE_BARCODE_SDK _writer = new BarcodeWriter(); _writer.Settings.Changed += new EventHandler(Settings_Changed); _writer.Settings.PixelFormat = BarcodeImagePixelFormat.Bgra32; #endif base.Cursor = System.Windows.Forms.Cursors.Cross; base.ActionCursor = base.Cursor; RectangularObjectTransformer transformer = new RectangularObjectTransformer(this); transformer.HideInteractionPointsWhenMoving = true; TransformController = transformer; // create the "Refresh barcode" button _refreshBarcodeButton = new InteractionButton(this); _refreshBarcodeButton.Image = DemosResourcesManager.GetResourceAsImage( @"DemosCommonCode.Imaging.VisualTools.BarcodeWriterTool.Resources.RefreshBarcodeImage.png"); // create the "Draw barcode" button _drawBarcodeButton = new InteractionButton(this); _drawBarcodeButton.Image = DemosResourcesManager.GetResourceAsImage( @"DemosCommonCode.Imaging.VisualTools.BarcodeWriterTool.Resources.DrawBarcodeImage.png"); // create the panel with buttons _controlButtonsPanel = new InteractionButtonsPanel(this, _refreshBarcodeButton, _drawBarcodeButton); _controlButtonsPanel.Interaction += new EventHandler <InteractionEventArgs>(ControlButtonsPanel_Interaction); }
/// <summary> /// Sets the properties of interaction controller according to the properties of annotation. /// </summary> /// <param name="controller">The interaction controller.</param> protected override void SetInteractionControllerProperties(IInteractionController controller) { base.SetInteractionControllerProperties(controller); RectangularObjectTransformer rectangularTransformer = controller as RectangularObjectTransformer; if (rectangularTransformer != null) { rectangularTransformer.CanMove = Data.CanMove; rectangularTransformer.CanResize = Data.CanResize; rectangularTransformer.CanRotate = Data.CanRotate; return; } }
/// <summary> /// Initializes a new instance of the <see cref="BarcodeReaderTool"/> class. /// </summary> public BarcodeReaderTool() { #if !REMOVE_BARCODE_SDK _reader = new BarcodeReader(); _reader.Progress += new EventHandler <BarcodeReaderProgressEventArgs>(Reader_Progress); #endif base.Cursor = System.Windows.Forms.Cursors.Cross; RectangularObjectTransformer transformer = new RectangularObjectTransformer(this); transformer.HideInteractionPointsWhenMoving = true; TransformController = transformer; TransformController.Interaction += new EventHandler <InteractionEventArgs>(TransformController_Interaction); ActionCursor = new Cursor(DemosResourcesManager.GetResourceAsStream( @"DemosCommonCode.Imaging.VisualTools.BarcodeReaderTool.Resources.BarcodeScanner.cur")); TransformController.MoveArea.Cursor = ActionCursor; }