| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_CMN_0102.cs
- * 2.功能描述:图片预览
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 庄天威 2014/09/13 1.00 新建
- *******************************************************************************/
- using System;
- using System.Drawing;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- namespace Dongke.IBOSS.PRD.Client.CommonModule.FormCommon
- {
- /// <summary>
- /// 图片预览
- /// </summary>
- public partial class F_CMN_0102 : Form
- {
- #region 构造函数
- public F_CMN_0102(byte[] ImageByte)
- {
- InitializeComponent();
- System.IO.MemoryStream ms = new System.IO.MemoryStream(ImageByte);
- System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms);
- this.picImage.Image = returnImage;
- this.Text = FormTitles.F_CMN_0102;
- this.btnClose.Text = ButtonText.BTN_CLOSE;
- }
- #endregion
- #region 事件
- /// <summary>
- /// 图片大小改变事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void picImage_SizeChanged(object sender, EventArgs e)
- {
- Image picNow = this.picImage.Image;
- if (picNow != null)
- {
- if (picNow.Height > this.picImage.Height || picNow.Width > this.picImage.Width)
- {
- this.picImage.SizeMode = PictureBoxSizeMode.Zoom;
- }
- else
- {
- this.picImage.SizeMode = PictureBoxSizeMode.CenterImage;
- }
- }
- }
- /// <summary>
- /// 关闭按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- #endregion
- }
- }
|