Problem copying a canvas using SourceColorKey
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Problem copying a canvas using SourceColorKey... Expand / Collapse
Author
Message
Posted 9/19/2007 4:09:25 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/20/2007 11:00:34 AM
Posts: 11, Visits: 25
Hello,

Although I can successfully run the animated red car sample included on the Canvas.Copy help page, I can't get a transparent background to work in my case, where I'm using a MovieDisplay object to do the drawing. I basically do this in an inline after the MovieDisplay has finished:

set arrowCanvas = Display.CreateCanvas
arrowCanvas.LoadImage "RedCar.bmp"
arrowCanvas.SourceColorKey = CColor("0,0,0")
Display.Canvas.Copy arrowCanvas, arrowSrcRect, arrowDstRect, ebEffectSourceColorKey

The background (that I was hoping to be transparent) turns out white.

Any ideas?

Thanks,

Shane



Post #636
Posted 9/21/2007 1:03:02 PM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Administrators
Last Login: Today @ 3:05:40 PM
Posts: 569, Visits: 1,237
Because you mentioned that you are using a MovieDisplay, the action you are attempting to perform may not be supported.  To provide real time support for Movies, E-Prime must render movie frames separately in hardware video memory.  For this to function, movie objects get their own Z-Order (http://en.wikipedia.org/wiki/Zorder) that is placed on top of the Z-Order of other objects being presented.  Thus, movie objects will always appear on top of the screen and not part of the Display.Canvas.  Therefore, when you perform the source color key you are doing so via what is under the movie frame being presented.  The other reason this is done is to ensure proper display/rendering.  For example, if a movie were playing when PreReleased into a ImageDiplay object that was transparent, it would render its contents based on the frame that was currently on display (which would likely be well prior to its onset).  At onset time, the display would then draw inaccurate results.

PST will investigate efforts to include a closer relationship between the Canvas object and movie stimuli.

-Brandon

Post #643
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 10:36pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 12 queries. Compression Disabled.