Hi,
I am in the process of building a windows service that uses the Quicktime COM control to access various movie (.mov) files. The purpose of using the control is to load the movie and take screen grabs from certain sections of the movie file.
The way the Quicktime control does this is to provide access to a method named CopyFrame(someFramelocation). This method places the frame into the clipboard so that it should be accessible via the IDataObject. The code i am about to go through works absolutely fine on my development machine which is a 64 bit install of Windows 7 with VS2008, .Net 3.5 SP1 running on it.
However, it seems that it will not work on Windows Server 2008. As it is a service i installed VS2008 on the server to debug it easily. Please find the code below, any help would be greatly appreciated.
Setting up the Quicktime control is done with the following code.
AxQTControl _quickTimeControl = new AxQTOControlLib.AxQTControl();
_quickTimeControl.Enabled = true;
_quickTimeControl.Name = "axQTControl1";
this.Controls.Add(_quickTimeControl);
_quickTimeControl.MovieControllerVisible = false;
_quickTimeControl.URL = FileToProcess.FullName;
Once the URL path is set the control automatically sets the controls movie property (which exposes the file specified by the URL). The movie property itself, which is of type QTMovie is read only.
QTMovie theMovie = _quickTimeControl.Movie;
Now we have the movie (as long as it is not null) we can copy a frame to the clipboard with the following code:
Clipboard.Clear();
theMovie.CopyFrame(15);
Ok, that about covers the Quicktime bit. Now the bit where i am having problems.
// frame is now on the clipboard
IDataObject data = Clipboard.GetDataObject();
if (data != null) - Data is not null
{
string[] test = data.GetFormats(true); - Returns Array With Bitmap in it
if (data.GetDataPresent(DataFormats.Bitmap)) - Evaluates to True, so data is present and in the required format
{
Image storyBoardImage = (Bitmap)data.GetData(DataFormats.Bitmap, true);
The image above is always null. I have tried every way of getting data out of the GetData() method but nothing works. As i say this works fine on my dev machine
}
If anyone can give me some advise as to how, even though all the checks for data and data types pass, the Getdata() method always returns null. This seems to just be a windows server 2008 issue - the code is identical to my dev machine, the movie files in question are the same, stored in the same network location.
This is driving me bonkers.