private void 复制CToolStripButton_Click(object sender, EventArgs e)
{
if(rasterImageViewer1.Image.HasRegion)
{
LeadRect rc = rasterImageViewer1.Image.GetRegionBounds(null);
// 将这一部分变为一张图片
RasterImage imgCopy = new RasterImage(rasterImageViewer1.Image.Clone(rc));
RasterClipboard.Copy(
rasterImageViewer1,
imgCopy,
RasterClipboardCopyFlags.Empty |
RasterClipboardCopyFlags.Dib |
RasterClipboardCopyFlags.Palette |
RasterClipboardCopyFlags.Region);
}
}
private void 粘贴PToolStripButton_Click(object sender, EventArgs e)
{
if (RasterClipboard.IsReady)
{
RasterImage newImage = RasterClipboard.Paste(rasterImageViewer1);
rasterImageViewer1.FloaterImage = newImage;
rasterImageViewer1.RegionToFloater();
rasterImageViewer1.FloaterVisible = true;
rasterImageViewer1.AnimateFloater = true;
rasterImageViewer1.InteractiveMode = RasterViewerInteractiveMode.Floater;
rasterImageViewer1.InteractiveRegionType = RasterViewerInteractiveRegionType.Freehand;
rasterImageViewer1.InteractiveRegionCombineMode = RasterRegionCombineMode.Set;
}
}
private void 剪切UToolStripButton_Click(object sender, EventArgs e)
{
LeadRect rc = rasterImageViewer1.Image.GetRegionBounds(null);
// 将这一部分变为一张图片
RasterImage imgCopy = new RasterImage(rasterImageViewer1.Image.Clone(rc));
RasterClipboard.Copy(
rasterImageViewer1,
imgCopy,
RasterClipboardCopyFlags.Empty |
RasterClipboardCopyFlags.Dib |
RasterClipboardCopyFlags.Palette |
RasterClipboardCopyFlags.Region);
//清除内部
clearInternal();
}
保存时再合并图像 |