F-IN-BOX .NET Help >> How to

How to create a translucency form

Using F-IN-BOX you are able to create applications based on transparent flash movies. You can create applications with translucency non-rectangle forms. Use Flash to make applications with modern user interface, make a business logic using .NET.

Use f_in_box__form component to work with transparency.

Please note that form transparency is supported only under Win2k (or higher), 16 / 32 bpp display mode. To check if the transparency is supported use the function IsTransparentModeAvailable:

[ C# ]
  1. // Check transparent mode  
  2. if (!f_in_box__lib.Global.IsTransparentModeAvailable)  
  3. {  
  4.    System.Windows.Forms.MessageBox.Show("Transparent mode is not available");  
  5.    return;  
  6. }  
  7.   
  8. // MyTranslucencyForm is inherited from f_in_box__lib.f_in_box__form  
  9. // Creating translucency form   
  10. MyTranslucencyForm FlashPlayerForm = new MyTranslucencyForm();  
  11.   
  12. // Loading movie from stream  
  13. System.IO.Stream MovieStream =   
  14.    System.Reflection.Assembly.GetExecutingAssembly().  
  15.       GetManifestResourceStream("Sample4_Translucency.Embedded_Movies.movie.swf");  
  16. FlashPlayerForm.PutMovieFromStream(MovieStream);  
  17.   
  18. // Positions  
  19. FlashPlayerForm.Width = 400;  
  20. FlashPlayerForm.Height = 400;  
  21. FlashPlayerForm.Left =   
  22.    System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width / 2 -   
  23.    FlashPlayerForm.Width / 2;  
  24. FlashPlayerForm.Top =   
  25.    System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height / 2 -   
  26.    FlashPlayerForm.Height / 2;  
  27.   
  28. // Play and...  
  29. FlashPlayerForm.FlashMethod_Play();  
  30. // ...show  
  31. FlashPlayerForm.Show();  
  32.   
  33. Application.Run(FlashPlayerForm);  

[ VB.Net ]
  1. ' Check transparent mode  
  2. If Not f_in_box__lib.Global.IsTransparentModeAvailable Then  
  3.    MessageBox.Show("Transparent mode is not available", _  
  4.                    Application.ProductName)  
  5.    Return  
  6. End If  
  7.   
  8. ' MyTranslucencyForm is inherited from f_in_box__lib.f_in_box__form;  
  9. ' Creating translucency form   
  10. Dim FlashPlayerForm As New MyTranslucencyForm  
  11.   
  12. ' Loading movie from stream  
  13. Dim MovieStream As System.IO.Stream = _  
  14.    System.Reflection.Assembly.GetExecutingAssembly._  
  15.       GetManifestResourceStream("Sample4_Translucency.movie.swf")  
  16. FlashPlayerForm.PutMovieFromStream(MovieStream)  
  17.   
  18. ' Positions  
  19. FlashPlayerForm.Width = 400  
  20. FlashPlayerForm.Height = 400  
  21. FlashPlayerForm.Left = _  
  22.    Screen.PrimaryScreen.WorkingArea.Width() / 2 - _  
  23.    FlashPlayerForm.Width / 2  
  24. FlashPlayerForm.Top = _  
  25.    Screen.PrimaryScreen.WorkingArea.Height() / 2 - _  
  26.    FlashPlayerForm.Height / 2  
  27.   
  28. ' Play and...  
  29. FlashPlayerForm.FlashMethod_Play()  
  30. ' ...show  
  31. FlashPlayerForm.Show()  
  32.   
  33. Application.Run(FlashPlayerForm)  


Copyright © Softanics. All rights reserved.
F-IN-BOX is a trademark of Softanics.
Macromedia and Shockwave Flash are trademarks of Adobe