I think I’ve found a bug in Vegas.SaveSnapshot() API. If you change the Vegas.Project.Preview.RenderQuality and Vegas.Project.Preview.FullSize, then Vegas.SaveSnapshot will take a snapshot of the current cursor position regardless of what position you pass in as the third parameter. When you call it a second time it will honor the position passed in.
The following test case proves this. All three snapshots, test1.jpg, test2.jpg and test3.jpg should be the same frame with different quality and size, but test2.jpg will be the frame under the Vegas.Cursor! One would especially expect that the last two calls to SaveSnapshot would be the same image but they are not. (at least not on my PC) ;-) Make sure you move the cursor to a frame other that 00:00:01:00 before you run this so you can see the effect.
~jr
The following test case proves this. All three snapshots, test1.jpg, test2.jpg and test3.jpg should be the same frame with different quality and size, but test2.jpg will be the frame under the Vegas.Cursor! One would especially expect that the last two calls to SaveSnapshot would be the same image but they are not. (at least not on my PC) ;-) Make sure you move the cursor to a frame other that 00:00:01:00 before you run this so you can see the effect.
/**
* Program: ASnapshotBug.js
* Description: This script shows that SaveSnapShot doesn't honor the position passed
* in if both the RenderQuality and Preview FullSize are changed. For this
* test case to work the Vegas Curor should not be at 00:00:01:00.
* Author: Johnny (Roy) Rofrano john_rofrano at hotmail dot com
*
* Date: March 27, 2004
**/
import System.Windows.Forms;
import SonicFoundry.Vegas;
var originalPreviewRenderQuality = Vegas.Project.Preview.RenderQuality;
var originalPreviewFillSize = Vegas.Project.Preview.FullSize;
try
{
// For this test the snap position is fixed so every
// snap should be the same frame!
var snapPosition : Timecode = new Timecode("00:00:01:00");
// take an initial snapshot as the control base
Vegas.SaveSnapshot("C:\\temp\\test1.jpg", ImageFileFormat.JPEG, snapPosition);
// But if you set the preview quality and size, the very next snapshot
// will be of the current cursor position and NOT the snapPosition
Vegas.Project.Preview.RenderQuality = VideoRenderQuality.Best;
Vegas.Project.Preview.FullSize = true;
// These two should be the same frame but theyr'e not!
Vegas.SaveSnapshot("C:\\temp\\test2.jpg", ImageFileFormat.JPEG, snapPosition);
Vegas.SaveSnapshot("C:\\temp\\test3.jpg", ImageFileFormat.JPEG, snapPosition);
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Vegas.Project.Preview.RenderQuality = originalPreviewRenderQuality;
Vegas.Project.Preview.FullSize = originalPreviewFillSize;
/** End of program **/See if you can reproduce this. Thanks,
~jr