Converting a PicHandle to format for use with imageData

Trevor DeVore lists at
Tue Dec 30 13:51:10 EST 2003

On Dec 29, 2003, at 3:29 PM, Thierry Arbellot wrote:
> So, the code should look like this:

Okay, I've implemented your code example and am able to get a picture 
into an image object in Revolution.  The pictures I grab from stills or 
movies don't look right however.  You can see what the image should 
look like here 
and what the image I am getting in Revolution looks like here 

I have tried various methods of putting an image into the GWorld (going 
to a certain time in the movie and putting that into the GWorld as well 
as using the QT API call GetMoviePict/GetMoviePosterPic) with the same 

Any ideas on what might be happening?

Here is the code:

// Get movie dimensions and create offscreen GWorld
GetMovieBox(mv, &movieFrame);
NewGWorld(&theGWorld, k32ARGBPixelFormat, &movieFrame, NULL, NULL, 

SetGWorld(theGWorld, NULL);

// get image from movie and put into GWorld
thePicHandle = GetMoviePosterPict (mv);
DrawPicture(thePicHandle, &movieFrame);

thePixMap = *(GetPortPixMap(theGWorld));

if (thePixMap->baseAddr != NULL) {
	rdata.sptr = thePixMap->baseAddr;
	rdata.length = movieFrame.right * movieFrame.bottom * 4;
	SetVariableEx(args[0], "", &rdata, &retvalue);
	retstr = (char *)malloc(8);
	sprintf(retstr, "%s", "Success");
} else {
	retstr = (char *)malloc(8);
	sprintf(retstr, "%s", "Failure");


Trevor DeVore
Blue Mango Multimedia
trevor at

More information about the Use-livecode mailing list