Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-21-2005, 12:57 AM
Junior Member
 
Join Date: Feb 2005
Posts: 4
Default Image.captureMovie

Hi,

I'm using the following code...

Code:
var img = Image.captureMovie(0,0,600,425);
The resulting bitmap captures the area that I want.

However, if I re-size the Windows window and the Flash movie's size is scaled (I'm using the 'Show All' scaling mode) then the above code only captures, say, a corner of the movie if the movie's size has been increased.

How do I find the new pixel dimensions and position (Show all can result in white bars above and below and to the sides of the movie) of the scaled movie?

Cheers,

I.
Reply With Quote
  #2 (permalink)  
Old 02-21-2005, 11:26 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Image.captureMovie

Please use
Code:
var img = Image.captureMovie();
to capture the entire movie.
Reply With Quote
  #3 (permalink)  
Old 02-21-2005, 06:53 PM
Junior Member
 
Join Date: Feb 2005
Posts: 4
Default Re:Image.captureMovie

I don't want the entire movie.

I have a swf loaded into a movie clip in the main movie and this inner swf is smaller than the main movie. But I only want to capture the inner swf so I need to specify the dimensions. But when I read out the dimensions of the inner swf (or the movie clip that contains it) they're always the same regardless of how the application window has been re-sized.
Reply With Quote
  #4 (permalink)  
Old 02-23-2005, 03:00 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Image.captureMovie

You need to call the FlashPlayer.movieToWindow method to translate the dimensions of the movie from movie coordinates system to the windows client coordinates system.

1. In action script get the bounds of the movie
Code:
pos = mymovie.getBounds();
2. In swfkit convert it
Code:
var mleft = parseInt(FlashPlayer.getVariable("_root.pos.xMin"));
var mtop = parseInt(FlashPlayer.getVariable("_root.pos.yMin"));
var mright = parseInt(FlashPlayer.getVariable("_root.pos.xMax"));
var mbottom = parseInt(FlashPlayer.getVariable("_root.pos.yMax"));

var rect = FlashPlayer.movieToWindow(mleft, mright, mtop, mbottom);

Image.captureMovie(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:43 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.