private void btnShowPreview_Click(object sender, EventArgs e) { //When more than one frame, create duplicate action and view action if (Package.PackageState != AMTUtil.State.READY) { return; } if (lbFrames.SelectedIndex == -1) { MessageBox.Show("You need to select a frame!"); return; } if (lbFrames.SelectedItems.Count > 1) { MessageBox.Show("You cannot view more than one frame."); return; } if (Package.Animation.Actions[lbActions.SelectedIndex].Frames[lbFrames.SelectedIndex].ActionRef == null) { AMTResource PreviewResource = AMTUtil.GetResourceFromName(Package, Package.Animation.Actions[lbActions.SelectedIndex].Frames[lbFrames.SelectedIndex].Resource); FramePreview PreviewWindow = new FramePreview(AMTUtil.BytesToImage(PreviewResource.Frames[Package.Animation.Actions[lbActions.SelectedIndex].Frames[lbFrames.SelectedIndex].FrameRef])); PreviewWindow.Show(); } else { ActionPreview PreviewWindow = new ActionPreview(Package, AMTUtil.GetActionFromName(Package.Animation, Package.Animation.Actions[lbActions.SelectedIndex].Frames[lbFrames.SelectedIndex].ActionRef)); PreviewWindow.Show(); } }
private void btnShowPreview_Click(object sender, EventArgs e) { //When more than one frame, create duplicate action and view action if (Package.PackageState != AMTUtil.State.READY) return; if (lbFrames.SelectedIndex == -1) { MessageBox.Show("You need to select a frame!"); return; } if (lbFrames.SelectedItems.Count > 1) { MessageBox.Show("You cannot view more than one frame."); return; } if (Package.Animation.Actions[lbActions.SelectedIndex].Frames[lbFrames.SelectedIndex].ActionRef == null) { AMTResource PreviewResource = AMTUtil.GetResourceFromName(Package, Package.Animation.Actions[lbActions.SelectedIndex].Frames[lbFrames.SelectedIndex].Resource); FramePreview PreviewWindow = new FramePreview(AMTUtil.BytesToImage(PreviewResource.Frames[Package.Animation.Actions[lbActions.SelectedIndex].Frames[lbFrames.SelectedIndex].FrameRef])); PreviewWindow.Show(); } else { ActionPreview PreviewWindow = new ActionPreview(Package, AMTUtil.GetActionFromName(Package.Animation, Package.Animation.Actions[lbActions.SelectedIndex].Frames[lbFrames.SelectedIndex].ActionRef)); PreviewWindow.Show(); } }
private void btnShowPreview_Click_1(object sender, EventArgs e) { FramePreview PreviewWindow = new FramePreview(ConvertBytesToImage(Frames[Animation.Actions[lbActions.SelectedIndex].Frames[lbFrames.SelectedIndex].FrameRef])); PreviewWindow.Show(); }