private void stretchToolStripMenuItem_Click(object sender, EventArgs e) { try { var bitmap = pictureEdit1.Image as Bitmap; if (bitmap == null) { return; } var size = bitmap.Size; using (var stretchDialog = new StretchDialog(new Size(size.Width, size.Height))) { if (stretchDialog.ShowDialog() != DialogResult.OK) { return; } var imageSize = stretchDialog.ImageSize; using (var builder = new StretchBuilder(imageSize)) { pictureEdit1.Image = builder.Stretch(bitmap); } } } catch (Exception exception) { MessageBox.Show(exception.Message); } }
private void stretch_ItemClick(object sender, ItemClickEventArgs e) { try { var bitmap = pictureEdit1.Image as Bitmap; if (bitmap == null) { return; } using (var stretchDialog = new StretchDialog(bitmap.Size)) { if (stretchDialog.ShowDialog() != DialogResult.OK) { return; } Size imageSize = stretchDialog.ImageSize; using (var builder = new StretchBuilder(imageSize)) pictureEdit1.Image = builder.Stretch(bitmap); } } catch (Exception exception) { XtraMessageBox.Show(exception.Message); } }
public CvBitmap(CvBitmap input, StretchBuilder builder, bool autoResize) : base(autoResize ? builder.Stretch(input).Data : input.Data) { }