Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with GraphicsImporter



Hi, I'm having troubles with importing Still Images into a movie using the GraphicsImporter. The problem is that I can only get the image scaled and moved to the right place on the screen if make the QDGraphics object the same size as the movie. However, if I do that then it makes the background colour for the QDGraphics object to be black (no matter what I set the colour to manually.

If I set the bounds and position of the QDGraphics object to be the scaled and moved location then the image is scaled properly, the background is as I want it but nothing I do will move the scaled image to the right X, Y location.

I'm going mad playing with combinations of things. Any help would be greatly appreciated. My test case has a white background, some text and the scaled, located image. Here's the code where I'm trying to add the image (There's lot of stuff in there trying to move the image that is scaled but not located properly, to change to the background messing version just uncomment the alternate scratch definition).

           QTFile imgFile = getImageFile(fcpVideo);
           GraphicsImporter gi = new GraphicsImporter(imgFile);

           // Resize image
           Matrix drawMatrix = new Matrix();
           QDRect fromRect = gi.getBoundsRect();
           QDRect toRect = new QDRect (x, y, width, height);
           drawMatrix.rect(fromRect, toRect);
           gi.setMatrix(drawMatrix);

// QDGraphics scratch = new QDGraphics(movie.getNaturalBoundsRect());
QDGraphics scratch = new QDGraphics(toRect);
scratch.moveTo(toRect.getX(), toRect.getY());
scratch.setBackColor(QDColor.white);


GraphicsMode alphaMode = new GraphicsMode(QDConstants.transparent, QDColor.white);
gi.setGraphicsMode(alphaMode);
gi.setGWorld(scratch, null);
gi.setBoundsRect(toRect);
gi.setDestRect(toRect);
gi.draw();


Many Thanks,
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-java/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.