private void imageToolStripMenuItem_Click(object sender, EventArgs e) { SFD.Filter = @"JPEG File (*.jpeg, *.jpg) | *.jpg | PNG File (*.png) | *.png | BMP File (*.bmp) | *.bmp | TIFF File (*.tif, *.tiff) | *.tiff | GIF File (*.gif) | *.gif | EMF File (*.emf) | *.emf "; SFD.FileName = "Log"; if (SFD.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(SFD.FileName)) { MiMFa_Convert.ToImage(this.Browser.DocumentText, SFD.FileName, Browser.Document.Body.ScrollRectangle.Size, false); } }
public static bool IsBitmap(byte[] obj) { if (obj == null) { return(false); } try { MiMFa_Convert.ToImage(obj); return(false); } catch { return(false); } }
private void StandardTopBorder_Load(object sender, EventArgs e) { pb_Logo.Image = MiMFa_Convert.ToImage(this.ParentForm.Icon); FORMMOVE.MainControl = this.ParentForm; if (!LockState && string.IsNullOrEmpty(ButtonLabel.Text) && this.ParentForm != null) { ButtonLabel.Font = l_Text.Font; ButtonLabel.Text = this.ParentForm.CompanyName + " " + this.ParentForm.ProductName + " v" + this.ParentForm.ProductVersion; ButtonLabel.Refresh(); } if (!LockState && string.IsNullOrEmpty(l_Text.Text) && this.ParentForm != null) { l_Text.Text = this.ParentForm.Text; } }
public static void ToolStripMenuItem_Creator(ref ToolStripMenuItem thisMenustrip, string Name, string Text = "", RightToLeft RightToLeft = RightToLeft.No, bool CheckOnClick = false, bool Checked = false, byte[] Image = null, bool Enabled = true, bool Visible = true, bool RightToLeftAutoMirrorImage = false, int PaddingAll = 0, int MarginAll = 0, DockStyle Dock = DockStyle.None, byte[] BackgroundImage = null) { try { thisMenustrip.Name = Name; thisMenustrip.Text = Text; thisMenustrip.Enabled = Enabled; thisMenustrip.Visible = Visible; thisMenustrip.Image = MiMFa_Convert.ToImage(Image); thisMenustrip.CheckOnClick = CheckOnClick; thisMenustrip.Checked = Checked; thisMenustrip.RightToLeft = RightToLeft; thisMenustrip.RightToLeftAutoMirrorImage = RightToLeftAutoMirrorImage; thisMenustrip.Padding = new Padding(PaddingAll); thisMenustrip.Margin = new Padding(MarginAll); thisMenustrip.Dock = Dock; thisMenustrip.BackgroundImage = MiMFa_Convert.ToImage(BackgroundImage); } catch { } }
public void SaveImage() { try { SFD.Filter = @"JPEG File (*.jpeg, *.jpg) | *.jpg | PNG File (*.png) | *.png | BMP File (*.bmp) | *.bmp | TIFF File (*.tif, *.tiff) | *.tiff | GIF File (*.gif) | *.gif | EMF File (*.emf) | *.emf "; SFD.FileName = MainReport.Name; if (SFD.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(SFD.FileName)) { MiMFa_Convert.ToImage(this.Viewer.DocumentText, SFD.FileName, Viewer.Document.Body.ScrollRectangle.Size, false); //Exclusive.Extension.MiMFa_Convert pc = new Exclusive.Extension.MiMFa_Convert(); //string addr = Config.TempDirectory + "mrloutput.html"; //MiMFa_IOService.StringToFile(addr, Viewer.DocumentText); //pc.ToImage(addr, SFD.FileName,false); } } catch (Exception ex) { if (MessageBox.Show(ex.Message, "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) == DialogResult.Retry) { SaveImage(); } } }