⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deliverysignaturestandard.cs

📁 微软的行业应用解决方案示例
💻 CS
字号:
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using HardwareDistributor.Properties;
using System.Drawing.Imaging;

namespace HardwareDistributor.UI
{
    public partial class DeliverySignatureStandard : DeliverySignatureBase
    {
        #region Constructors

        public DeliverySignatureStandard(Guid orderId, int customerId)
            : base(orderId, customerId)
        {
            InitializeComponent();

            //get localized string for the message
            this.label1.Text = Resources.TypeNameMessage;
        }

        #endregion

        #region EventHandlers

        /// <summary>
        /// Go back to the last state in the delivery wizard
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuBack_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        #endregion

        #region DeliverySignatureBase Methods

        /// <summary>
        /// Create image file in specified directory
        /// </summary>
        /// <param name="filePath">absolute full path of the output image file</param>
        /// <param name="imageFormat">Image format (gif, jpeg, etc...)</param>
        protected override void CreateSignatureImageFile(string filePath, ImageFormat imageFormat)
        {
            //Save the signature as a GIF file
            HardwareDistributor.Utilities.Utility.CaptureScreenShot(
                this.SignatureTextbox.Location.X, 
                this.SignatureTextbox.Location.Y,
                this.SignatureTextbox.ClientRectangle.Width, 
                this.SignatureTextbox.ClientRectangle.Height,
                this.CreateGraphics(), 
                filePath, 
                imageFormat);

        }

        /// <summary>
        /// Return status of user signature entry
        /// </summary>
        /// <returns>true if signature has been captured on screen, else false</returns>
        protected override bool SignatureCaptured()
        {
            return (this.SignatureTextbox.Text.Length != 0);
        }

        #endregion
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -