protected void btSave_MouseClick(object sender, MouseEventArgs e) { foreach (XTextBox render in this.tempRender.TextBoxDic.Values) { if (render.IsError) { // MessageBoxEx.Show("录入不正确:" + render.ErrorText, "错误提示", MessageBoxButtons.OKCancel, MessageBoxIconEx.Error); MessageBoxEx.Show("录入不正确:" + render.ErrorText, "错误提示"); render.Focus(); return; } } TeethBitmap teethRender = new TeethBitmap(tempRender); teethRender.Preview = false; teethRender.SickPositionStr = this.tempRender.TeethRender.SickPositionStr; teethRender.Location = new Point(0, 0); this.Toothmap = new Bitmap(teethRender.Size.Width + 1, teethRender.Size.Height + 1); Graphics grapPath = Graphics.FromImage(Toothmap); grapPath.Clear(Color.White); grapPath.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; teethRender.Render(grapPath); BmpConvertMessage.BitmapInput(Toothmap, teethRender.SickPositionStr); this.DialogResult = DialogResult.OK; }
void UserRender_MouseDoubleClick(object sender, MouseEventArgs e) { XPictureBox xapPictureBox = sender as XPictureBox; using (ToothBitmapView tooth = new ToothBitmapView()) { if (xapPictureBox.Image != null && !string.IsNullOrEmpty(BmpConvertMessage.BitmapOutput((Bitmap)xapPictureBox.Image))) { tooth.SickPositionStr = BmpConvertMessage.BitmapOutput((Bitmap)xapPictureBox.Image); } if (tooth.ShowDialog() == DialogResult.OK) { xapPictureBox.Image = tooth.Toothmap; if (xapPictureBox.Name.Equals("def1")) { (this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def2 = BmpConvertMessage.BitmapOutput(tooth.Toothmap); } } } }
private void loadToothPicture(string toothstr, XLabelBaseUserRender toothLabel) { if (string.IsNullOrEmpty(toothstr)) { return; } TeethBitmap teethRender = new TeethBitmap(toothstr); teethRender.Preview = false; teethRender.Location = new Point(0, 0); Bitmap Toothmap2 = new Bitmap(teethRender.Size.Width + 1, teethRender.Size.Height + 1); Graphics grapPath = Graphics.FromImage(Toothmap2); grapPath.Clear(Color.White); grapPath.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; teethRender.Render(grapPath); (toothLabel.UserRender as XPictureBox).Image = Toothmap2; BmpConvertMessage.BitmapInput(Toothmap2, toothstr); (toothLabel.UserRender as XPictureBox).Invalidate(); }
void UserRender_MouseDoubleClick(object sender, MouseEventArgs e) { XPictureBox xapPictureBox = sender as XPictureBox; using (ToothBitmapView tooth = new ToothBitmapView()) { if (xapPictureBox.Image != null && !string.IsNullOrEmpty(BmpConvertMessage.BitmapOutput((Bitmap)xapPictureBox.Image))) { tooth.SickPositionStr = BmpConvertMessage.BitmapOutput((Bitmap)xapPictureBox.Image); } if (tooth.ShowDialog() == DialogResult.OK) { xapPictureBox.Image = tooth.Toothmap; if (xapPictureBox.Name.Equals("def2")) { (this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def2 = BmpConvertMessage.BitmapOutput(tooth.Toothmap); if (!string.IsNullOrEmpty((this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def2)) { checkbox1.Checked = true; } xapPictureBox.Invalidate(); } else if (xapPictureBox.Name.Equals("def4")) { (this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def4 = BmpConvertMessage.BitmapOutput(tooth.Toothmap); if (!string.IsNullOrEmpty((this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def4)) { checkbox2.Checked = true; } xapPictureBox.Invalidate(); } else if (xapPictureBox.Name.Equals("def6")) { (this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def6 = BmpConvertMessage.BitmapOutput(tooth.Toothmap); if (!string.IsNullOrEmpty((this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def6)) { checkbox3.Checked = true; } xapPictureBox.Invalidate(); } else if (xapPictureBox.Name.Equals("def8")) { (this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def8 = BmpConvertMessage.BitmapOutput(tooth.Toothmap); if (!string.IsNullOrEmpty((this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def8)) { checkbox4.Checked = true; } xapPictureBox.Invalidate(); } else if (xapPictureBox.Name.Equals("def10")) { (this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def10 = BmpConvertMessage.BitmapOutput(tooth.Toothmap); if (!string.IsNullOrEmpty((this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def10)) { checkbox5.Checked = true; } xapPictureBox.Invalidate(); } else if (xapPictureBox.Name.Equals("def12")) { (this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def12 = BmpConvertMessage.BitmapOutput(tooth.Toothmap); if (!string.IsNullOrEmpty((this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def12)) { checkbox6.Checked = true; } xapPictureBox.Invalidate(); } else if (xapPictureBox.Name.Equals("def14")) { (this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def14 = BmpConvertMessage.BitmapOutput(tooth.Toothmap); if (!string.IsNullOrEmpty((this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def14)) { checkbox7.Checked = true; } xapPictureBox.Invalidate(); } else if (xapPictureBox.Name.Equals("def16")) { (this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def16 = BmpConvertMessage.BitmapOutput(tooth.Toothmap); if (!string.IsNullOrEmpty((this.GetViewModel().GetEmsUIDTO() as EmsUIDTO).Emsapobs.Def16)) { checkbox8.Checked = true; } xapPictureBox.Invalidate(); } } } }