Full Transparency Support
With F-IN-BOX, you can create applications based on transparent Flash movies, enabling translucent and non-rectangular user interfaces. This allows you to design modern, visually rich applications in Flash, while implementing business logic in .NET.
To work with transparency, use the f_in_box__form
component. Transparency is supported only on Windows 2000 or higher, in 16 or 32 bits-per-pixel display modes.
You can check if transparency is available using IsTransparentModeAvailable
.
C# Example
// Check transparent mode
if (!f_in_box__lib.Global.IsTransparentModeAvailable)
{
System.Windows.Forms.MessageBox.Show("Transparent mode is not available");
return;
}
// MyTranslucencyForm is inherited from f_in_box__lib.f_in_box__form
// Create translucency form
MyTranslucencyForm FlashPlayerForm = new MyTranslucencyForm();
// Load movie from stream
System.IO.Stream MovieStream =
System.Reflection.Assembly.GetExecutingAssembly().
GetManifestResourceStream("Sample4_Translucency.Embedded_Movies.movie.swf");
FlashPlayerForm.PutMovieFromStream(MovieStream);
// Position the form
FlashPlayerForm.Width = 400;
FlashPlayerForm.Height = 400;
FlashPlayerForm.Left =
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width / 2 -
FlashPlayerForm.Width / 2;
FlashPlayerForm.Top =
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height / 2 -
FlashPlayerForm.Height / 2;
// Play and display
FlashPlayerForm.FlashMethod_Play();
FlashPlayerForm.Show();
Application.Run(FlashPlayerForm);
VB.NET Example
' Check transparent mode
If Not f_in_box__lib.Global.IsTransparentModeAvailable Then
MessageBox.Show("Transparent mode is not available", Application.ProductName)
Return
End If
' MyTranslucencyForm is inherited from f_in_box__lib.f_in_box__form
' Create translucency form
Dim FlashPlayerForm As New MyTranslucencyForm
' Load movie from stream
Dim MovieStream As System.IO.Stream = _
System.Reflection.Assembly.GetExecutingAssembly._
GetManifestResourceStream("Sample4_Translucency.movie.swf")
FlashPlayerForm.PutMovieFromStream(MovieStream)
' Position the form
FlashPlayerForm.Width = 400
FlashPlayerForm.Height = 400
FlashPlayerForm.Left = _
Screen.PrimaryScreen.WorkingArea.Width() / 2 - _
FlashPlayerForm.Width / 2
FlashPlayerForm.Top = _
Screen.PrimaryScreen.WorkingArea.Height() / 2 - _
FlashPlayerForm.Height / 2
' Play and display
FlashPlayerForm.FlashMethod_Play()
FlashPlayerForm.Show()
Application.Run(FlashPlayerForm)
This feature enables advanced UI design, allowing applications to leverage Flash for complex visuals while maintaining .NET integration.