Oct 07
It’s not difficult to make a full screen application. But the sample below can save you a lot of time to look around a reference from the Internet.
Vote for this sample
Flash is Better? (96 votes)
Silverlight is Better! (138 votes)
Comparison
Flash implementation: 20 minutes
Silverlight implementation: 30 minutes (Implemented First)
What’s the difference?
- stage.displayState[AS3] vs Application.Current.Host.Content.IsFullScreen [C#]
Source codes
Full Screen Demo [Flash 9, AS3] (11.1 KiB, 323 hits)
Full Screen Demo [Silverlight 2, C#] (16.1 KiB, 392 hits)
Flash
Silverlight
Full Screen: stage.displayState[AS3] vs Application.Current.Host.Content.IsFullScreen [C#]
Switching to Full Screen Mode is very easy. Here is a simple demonstration.
// AS3
stage.displayState = ( stage.displayState == StageDisplayState.FULL_SCREEN)
? StageDisplayState.NORMAL : StageDisplayState.FULL_SCREEN;
stage.addEventListener(FullScreenEvent.FULL_SCREEN, on_full_screen);
private function on_full_screen(e : FullScreenEvent):void{
// get the full screen dimension
var screenWidth:Number = stage.stageWidth;
var screenHeight:Number = stage.stageHeight;
}
Code in C# is similar to than in AS3. It’s pretty straight forward. I don’t describe too much this time.
// C#
Application.Current.Host.Content.IsFullScreen = !Application.Current.Host.Content.IsFullScreen;
Application.Current.Host.Content.FullScreenChanged += new EventHandler(Content_FullScreenChanged);
void Content_FullScreenChanged(object sender, EventArgs e)
{
// get the full screen dimension
double screenWidth = Application.Current.Host.Content.ActualWidth;
double screenHeight= Application.Current.Host.Content.ActualHeight;
}
October 7th, 2008 at 4:28 am
The Silverlight version doesn’t work for me in Firefox (works fine in IE). But I guess it must just be me since Silverlight is winning in the votes?
October 7th, 2008 at 6:39 am
Silverlight does not work in Firefox for Full Screen. I confirmed!
October 7th, 2008 at 3:53 pm
Full Screen Silverlight works greatly on my Firefox
October 7th, 2008 at 8:41 pm
of course that silverlight works, just as flash does…
October 7th, 2008 at 11:18 pm
The Silverlight version seems to be A LOT faster and responsive when I click to full screen!
October 8th, 2008 at 2:17 am
Thanks for posting the testing result. I only got Firefox 2 installed and Silverlight is not working on it. I even don’t have any chance to see whether it is working or not. haha.
October 9th, 2008 at 5:57 pm
The Silverlight one doesn’t work for me as well in Firefox 3
October 10th, 2008 at 9:14 am
The Flash one is faster for me. Plus it makes more sense as it correctly uses the correct current monitor in dual monitor environments. The Flash one opens fullscreen on the same monitor as your browser window happens to be on, while the Silverlight example opens on the main screen 1 only. I’m not sure if this is your implementation or a limitation of Silverlight’s player…