Click here to Skip to main content
Click here to Skip to main content

An Alpha Channel Composited Windows Form with Designer Support

By , 5 Oct 2009
 

Download Instructions

Please add the decompressed folders (Help and SlidingPanes) from AlphaForm_1_1_3_Part2.zip to the main project folder in AlphaForm_1_1_3_Part1.zip.

Screenshot - mainsplash.jpg

Introduction

Windows has long had the ability to specify a region or transparency key allowing you to define an arbitrary Window border. This is often used with a background image to define an image outline as a Window frame. However, this border is composited with the desktop as a one bit mask giving you a pixelated boundary. It is especially unattractive with curvilinear borders which really need antialiasing and per pixel compositing. Aside from the unsightliness, it's not easy to define the region and/or transparency key to achieve a complex image based Window frame.

This is a Windows Forms control that works with Win32 APIs and without WPF. The control allows you to layout a 32 bit image with an alpha channel in the Forms designer and arrange additional controls within user specified areas of the image. At runtime, the control will generate a per pixel alpha composited Form with the desktop. The Form's Region property defines areas of the Form to host other controls, and it's calculated on the fly from the image's alpha channel. This control also supports runtime changing of the image. Before we discuss some of the code specifics, let's run through how you use it.

How To Use

  1. There are two controls: AlphaFormTransformer and a helper control AlphaFormMarker. Reference the AlphaFormTransformer.dll in your project and add them to your Toolbox.
  2. Start with a Form in the designer, and set its FormBorderStyle to None.
  3. Drag an instance of the AlphaFormTransformer control (AFT) onto the Form and dock it to Fill. The AFT must be the same size as the Form.
  4. In the Form's Load event handler (or OnLoad override), add a call to TransformForm()
    alphaFormTransformer1.TransformForm();
  5. Select a 32 bit alpha channel PNG or TIF image as the AFT control's background image. This image needs to have the desired Window frame elements masked by its alpha channel and interior transparent areas that will hold other controls.

    Screenshot - img1.jpg

  6. Select the form, and set its width and height equal to the width and height of the image. This is an important prerequisite. The form, AFT control, and the AFT's background image must all have the same dimensions.
  7. By itself, the alpha channel is not enough information for the AFT to calculate the main form's Region necessary to show the controls you will be adding. But we make it easy. Drag an AlphaFormMarker (AFM) control into each transparent region that will show controls. These areas must be completely bounded by a non-transparent border. Each marker simply needs to be anywhere in the transparent region, and its center (shown by the crosshairs) must fall on a transparent pixel. Once positioned, make them as small as desired, or send them to the back to get them out of the way. It's important to note that they must be added to the AFT and not to any other container control. Be mindful of this if you decide to add them later. Finally, they are hidden at run time.

    The marker's FillBorder property specifies how far into the non-transparent pixel border the region will be constructed. The composited image will typically have semitransparent edges. Therefore the region that's built from the marker position needs to expand some number of pixels into (and *under* from the compositing point of view) the semitransparent area, otherwise you will see through to the desktop along these borders. You want the border value to be large enough to cover the thickness of the semitransparent edge (typically a couple pixels), but not too large which might cause it to extend past the other side of the image frame.

    Screenshot - img3.jpg

  8. Now add whatever other controls you like to the interior transparent regions of the image. The AFT is a container control (descends from Panel), so you will be adding the controls to it. The image will always mask out the control area(s) at run time, but not necessarily at design time. If you don't set a control's background color to transparent, it may cover the masked borders of the image while in the designer because it's on top whereas at run time it's beneath the alpha channel image. By setting a control's background color to transparent, you can essentially fake the runtime behavior. And doing this can help you lay things out even if you later change it to a non-transparent color. Not all controls support a non-transparent background color, so in some cases your controls may overlap the image borders in the designer.

    Screenshot - img2.jpg

  9. That's it, let's run and see what we have.

    Screenshot - img4.jpg

  10. Optionally, we can set the background image property of the main Form and set each control's background color to transparent. This allows us to have a custom background like you see below. You could also achieve this by using additional controls like panels each with their own background.

    Screenshot - img5.jpg

Runtime Skinning

At run time, you can change the form's alpha channel image by calling UpdateSkin passing a new bitmap for the window frame. However if the new bitmap has a different alpha channel than the current one, then you must do the following *before* calling this method:

  1. If the size of the image has changed, resize the main Form and the AFT to match (if the AFT is docked then just the form).
  2. Reposition all AFM markers so that the form's region can be calculated.
  3. Reposition all other controls as needed.

On the other hand, if your new image has the same size and alpha but different RGB, then this method is all you need to call. The source solution has a sample project illustrating how to change the image at runtime.

How It Works

As you might have guessed, what we're really doing is creating a second Window which hosts the composited image on top of the main Form. This all happens in TransformForm() which does the following:

  1. A layered Window Form is created. This is a Window with the WS_EX_LAYERED extended style bit set. Windows will alpha channel composite layered windows on the desktop once the window contents are set with the Win32 call UpdateLayeredWindow(). We've wrapped a class around this called LayeredWindowForm:
    m_lwin = new LayeredWindowForm();
    
    // Setting the layered Window's TopMost to the main
    // Form's value keeps the relative Z order the same for
    // the pair of Windows
    m_lwin.TopMost = ParentForm.TopMost;
    
    // We don't want the layered Window Form to show in the taskbar
    m_lwin.ShowInTaskbar = false;
    
    // These will handle dragging for both the layered Window
    // and the main Form.
    m_lwin.MouseDown += new MouseEventHandler(LayeredFormMouseDown);
    m_lwin.MouseMove += new MouseEventHandler(LayeredFormMouseMove);
    m_lwin.MouseUp += new MouseEventHandler(LayeredFormMouseUp);
    ParentForm.Move += new EventHandler(ParentFormMove);
    
    // Layered form shown with same size and location
    // It's not necessary to set the size of the layered
    // Window as LayeredWindowForm.SetBits() will do this.
    m_lwin.Show(ParentForm);
    m_lwin.Location = ParentForm.Location;
  2. A bitmap is extracted from the AFT's background image property. It may be scaled in some situations (see the comments here on DPI support). After this, UpdateSkin() is called.

    if (BackgroundImage != null)
    {
      // A prerequisite with this control is that the main Form's size
      // is set equal to the background image size. However, if the main
      // Form's AutoScaleMode is set to DPI, and the application is run
      // on a system where the font or DPI resolution differs from the
      // design time values, then .NET will scale the form and all its
      // controls. However the background image is not scaled, so we'll
      // catch that condition here and scale the image accordingly.
      // Again, this logic works *assuming* you always set the main Form's
      // size equal to the image size at design time.
      if (BackgroundImage.Size != ParentForm.Size)
      {
        aphaBmap = new Bitmap(ParentForm.Width, ParentForm.Height);
        Graphics gr = Graphics.FromImage(aphaBmap );
        gr.SmoothingMode = SmoothingMode.HighQuality;
        gr.CompositingQuality = CompositingQuality.HighQuality;
        gr.InterpolationMode = InterpolationMode.HighQualityBicubic;
        gr.DrawImage(BackgroundImage, new Rectangle(0, 0, ParentForm.Width,
          ParentForm.Height),
          new Rectangle(0, 0, BackgroundImage.Width, BackgroundImage.Height),
                            GraphicsUnit.Pixel);
        gr.Dispose();
      }
      else
        aphaBmap = new Bitmap(BackgroundImage);
    }
    
    // Update the layered Window bits and Form region
    UpdateSkin(aphaBmap);
  3. In UpdateSkin, an array from the image's alpha channel is created. This is used in the next step to construct the main form's Region.
    // Seems faster albeit somewhat wasteful to marshal to a
    // managed array than to use Bitmap.GetPixel. If you're
    // OK with unsafe code, then define FAST_ALPHA_BUILD and
    // enable unsafe compilation.
    byte[] mngImgData = new byte[m_alphaBitmap.Height * bData.Stride];
    Marshal.Copy(bData.Scan0, mngImgData, 0, mngImgData.Length);
    for (int j = 0; j < m_alphaBitmap.Height; j++)
    {
      int ai = j * bData.Stride + 3;
      for (int i = 0; i < m_alphaBitmap.Width; i++, ai += 4)
      {
        alphaArr[i, j] = mngImgData[ai];
      }
    }
  4. Still within UpdateSkin, the main Form's Region is constructed. The Region will define the visible areas of the Form where you place your controls (the controls are hosted in the AFT, but everything is clipped by the main Form's region). The Region is constructed on the fly by performing a seed fill type operation from the user specified AFM markers which occurs in UpdateRectListFromAlpha(). These markers are little more than special helper controls which are dragged onto the Form in design mode. In essence, we're filling specific transparent areas of the image's alpha channel. For each such "filled" pixel, we generate a rectangle to be used to construct the main Form's Region.
    Rectangle bounds = new Rectangle();
    ArrayList rectList = new ArrayList();
    
    // The location of each AlphaFormMarker control serves as a seed point
    // location for building the set of rectangles that describe the
    // enclosed transparent region (within the background image's alpha
    // channel) around that point.
    foreach (Control cntrl in Controls)
    {
      if (typeof(AlphaFormMarker).IsInstanceOfType(cntrl))
      {
        AlphaFormMarker marker = (AlphaFormMarker)cntrl;
        UpdateRectListFromAlpha( rectList, ref bounds,
          new Point(marker.Location.X + marker.Width / 2,
          marker.Location.Y + marker.Height / 2), alphaArr,
          m_alphaBitmap.Width, m_alphaBitmap.Height,
          (int)marker.FillBorder);
    
        // Hide the marker as we don't want to see it at run time.
        marker.Visible = false;
      }
    }
    
    // Build the main Form's region
    ParentForm.Region = RegionFromRectList(rectList, bounds);
  5. Finally in UpdateSkin, the alpha channel image bitmap is set to the layered form.
    // Set the layered Window bitmap
    m_lwin.SetBits(m_alphaBitmap); 
  6. At the bottom of TransformForm(), the AFT's background image and tiling are copied from the main Form. This allows us to have a custom background image if desired.
    // Swap in the main form's background image (if any) and layout
    BackgroundImage = ParentForm.BackgroundImage;
    BackgroundImageLayout = ParentForm.BackgroundImageLayout;

Points of Interest

Dragging the Window is accomplished by dragging any visible part of the layered Window (our Window frame). When a mouse drag event in LayeredFormMouseMove() occurs, it moves the main Form but lets the Move event handler ParentFormMove() move the layered window. This handles cases where the Form is moved outside of a drag operation. For example, when the taskbar's autohide is unchecked, Windows may cause the Form to be relocated.

Also on Window XP, ParentFormMove() tries to help the desktop and underlying Windows catch up to redrawing invalidated areas (remember we're actually moving two Windows although the layered Window of the pair is double buffered). If it detects we're dragging the Form, it sleeps the main thread according to the DragSleep property. A reasonable value like 30 milliseconds makes for less distracting redrawing of the invalidated parts of the desktop. Under Vista, this property is ignored as the DWM double buffers everything.

Finally, PInvoking is unavoidable for both for the layered Window APIs and ExtCreateRegion() which has to be used because of the poor performance of building a Region from a GraphicsPath or Region.Union().

Summary

In this article we've presented a Windows Forms control that allows you to build arbitrarily complex image based Window elements with designer level support and runtime alpha channel compositing.

History

  • Version 1.0
    • Initial release
  • Version 1.1.1
    • 7/15/09: The code in this article was the basis for a shareware component called “AlphaForm” which I'm now releasing as freeware under the CodeProject 1.02 license. This is version 1.1.1 and includes a number of new features and bug fixes since the original CodeProject article. There are also expanded tutorials and a compiled help file.
  • Version 1.1.3 includes a few new features and bug fixes, namely:
    • Routines for showing and hiding alpha forms
    • Bug fix for x64
    • New example showing multiple, animated alpha forms

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Jeff J Anderson
Software Developer
United States United States
Jeff Anderson has been a computer graphics software developer for over twenty years.
 
He is a co-founder of Braid Art Labs and a developer of Braid's GroBoto 3D software. Jeff also dabbles in shareware with an expanded version of the AlphaForm control and other programs here.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionHi Mr Anderson PinmemberJason S Mummery19hrs 19mins ago 
I have downloaded your project from 'Code Project' and also your OSWebBrowser from Google however
unfortunately the latter makes uses of additional functions not included in your source in
'Code Project', specifically the method ResizeRegions in the alphaFormTransformer class and the
ResizeRegionType enum.
 
can you upload a revision on 'Code Project' containing these changes so I can utilise the resize feature.
QuestionAlphaForm invisible to recording software. PinmemberBen Carrington3-Jan-13 0:01 
When I try to record the application only the underlying form shows its components but not the skin :/
 
AlphaForms allows me to create stunning windows forms, thanks.
But I really want to be able to show the world via youtube etc...
 
Can anyone help me?
GeneralMy vote of 5 Pinmembermanoj kumar choubey28-Nov-12 18:24 
Nice
QuestionAlphaForm shows in Taskbar only Pinmemberdherrmann24-Oct-12 6:21 
Hi,
 
I'm using your method as DLL in a VB.Net environment. I did all what you wrote in the description above.
But, when I start my form, it always shows minimized in the taskbar only, not on desktop...(??)
What can it be?
After all, how should the backgroundimagelayout be set in the form and the alphaformtransformer?
centered or stretched or...
 
regards from Austria-
Dietrich
GeneralMy vote of 5 Pinmembersoulprovidergr18-Sep-12 1:33 
Great Job.
Really Usefull!!!
GeneralMy vote of 5 Pinmemberfahad1214-Aug-12 20:58 
Creative
QuestionGreat job! Can change transparency dynamically at run time? PinmemberYawness15-May-12 20:40 
How to change the transparency dynamically?
QuestionBackground showing through on drag. PinmemberMember 149455413-May-12 22:24 
Hiyas, love this in general, but I've got a problem with my form. When I drag it around the background where my controls are shows through. It sorts itself out when the drag stops, but during the drag it's as if the controls on top of the form are lagging behind the form's movement, hence bits of the underneath show through until they `catch up'.
 
Here's what I'm doing:
 
(1) Each control (buttons) has a rectangle in the skin that's transparent.
(2) I place a marker into each rectangle where a control is to appear (border = 0)
(3) I place the control over the transparent box such that it fits perfectly.
 
As I say, when dragging the edges around the controls show through to the desktop.
 
Any hints?
QuestionHow are created the musical programs gui? PinmemberMember 792126819-Apr-12 8:49 
I means program like editor audio or video with beautiful slider, pot etc.
QuestionVisual Basic.net An Alpha Channel Composited Windows Form with Designer Support PinmembervbGoof20-Mar-12 5:17 
I have seen the article for [An Alpha Channel Composited Windows Form with Designer Support] for c sharp. How do i do that in vb 2010
 
I would like to smooth out the edges of a circular form in VB. Any method that works is welcome
QuestionDifficult 2 use PinmemberMember 793369229-Jun-11 5:28 
it is Difficult 2 use, so anybody tell me how can we use it simply
GeneralCanDrag & Parenting PinmemberQwertyXoid14-Apr-11 0:52 
Hello!
I wanted to thank you for your project, it been a hell of a good helper for me Smile | :)
 
During the use I noticed 2 things that bugs me a lot...
First is the CanDrag option... No matter what I will set in the properties window or even in code, the form is still drag-able Frown | :(
Second is pretty unussual, and I dont sure that is fixable. The problem is that my form suppossed to be a child of the desktop. I achieve it by this code:
            IntPtr hDesk = FindWindow("Progman", "Program Manager");
            if (hDesk != IntPtr.Zero)
            {
                hDesk = FindWindowEx(hDesk, IntPtr.Zero, "SHELLDLL_DefView", "");
                if (hDesk != IntPtr.Zero)
                {
                    hDesk = FindWindowEx(hDesk, IntPtr.Zero, "SysListView32", "FolderView");
                    if (hDesk != IntPtr.Zero)
                    {
                        SetParent(this.Handle, hDesk);
                    }
                }
            }
And it works fine for a regular form. But when I did this to a form that had alphaFormTransformer, it had a wierd effect.
The region of the form, was the child of the desktop... But the PNG that is the background for alphaFormTransformer, acted like a ussual window(could get on top of other windows).
 
Can you help me to get rid of this annoying effect? Thanks!
Generalbug report Pinmembermetalion7-Nov-10 23:17 
We're developing a small app using alphaform to make a nice user interface. (thanks a lot for alphaform!, is a lifesaver!)
 
In some of our test machines, we are getting this exception:
 
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at AlphaForm.AlphaFormTransformer.UpdateRectListFromAlpha(ArrayList rectList, Rectangle& bounds, Point seedPt, Byte[,] alphaArr, Int32 width, Int32 height, Int32 border)
at AlphaForm.AlphaFormTransformer.UpdateSkin(Bitmap frameBmap, Bitmap backBmap, Byte opacity)
at AlphaForm.AlphaFormTransformer.TransformForm(Byte opacity)
 
We don't know why it happens, the skin is always the same, and we don't understand why in most cases it's working normally, and in some other is not.
GeneralMinor bug report PinmemberHenry.Ayoola26-May-10 23:42 

Spot the bug in the following excerpt of code from v1.1.3:

        public void UpdateSkin(Bitmap frameBmap, Bitmap backBmap, byte opacity)
        {
            // From an internal perspective, frameBmap is the layered window contents
            // and backBmap becomes (potentially after scaling) the transformer control
            // BackgroundImage.
 
            if (frameBmap == null && backBmap == null)
                throw new ApplicationException("Must specify at least one bitmap to UpdateSkin()");
            if (!Bitmap.IsCanonicalPixelFormat(frameBmap.PixelFormat) || !Bitmap.IsAlphaPixelFormat(frameBmap.PixelFormat))
                throw new ApplicationException("The frame bitmap must be 32 bits per pixel with an alpha channel.");

(The initial test allows frameBmap to be null if backBmap isn't, but the following line will then throw a NullReferenceException).


GeneralSplashScreen and CanDrag property PingroupC. Groß23-Feb-10 11:23 
When you want to use it for a SplashScreen for example (i.e. no controls, just an empty form except for the alphaFormTransformer, the user will be able to drag around the Form anyway, even if the CanDrag property is set to false. Just change one line inside of the LayeredFormMouseDown() function to this:
 
if (CanDrag && e.Button == MouseButtons.Left)
 
Works fine! Is this a bug? I actually can't see the CanDrag property being checked anywhere in the class!
QuestionIs there a resizeable version available? PinmemberWizzard022-Oct-09 14:16 
Some kind of 9-grid sizing would absolutely rock, too...
AnswerRe: Is there a resizeable version available? PinmemberJeff J Anderson22-Oct-09 18:51 
GeneralRe: Is there a resizeable version available? Pinmemberd0max4-Nov-09 3:56 
GeneralRe: Is there a resizeable version available? PinmemberOdys!23-Dec-09 16:13 
GeneralRe: Is there a resizeable version available? Pinmemberd0max24-Dec-09 1:15 
GeneralRe: Is there a resizeable version available? PinmemberJeff J Anderson26-Feb-10 4:45 
GeneralRe: Is there a resizeable version available? Pinmemberdejanstanic21-Oct-11 3:05 
GeneralRe: Is there a resizeable version available? Pinmemberd0max21-Oct-11 3:36 
GeneralRe: Is there a resizeable version available? Pinmemberpikipoki22-Oct-11 1:21 
GeneralRe: Is there a resizeable version available? Pinmemberdejanstanic26-Oct-11 0:19 
GeneralThanks for new Version! Performance questions PinmemberAbrojus5-Oct-09 21:21 
Ok finally had the chance to check the new version and the hiding works flawless, not to mention the new examples are very clear.
 
So far performance doesn't seem to much of a concern but i haven't done anything too big with it.
 
So i am wondering the following.
Lest assume a standard business app, you know some data manipulation and reporting, some charts here and there. Assuming computers with, lets say, single core cpu and 512mb ram running winXP. Would this library (or similar per pixel alpha blending) on top of windows forms be fast enough? How would it compare with WPF (and eye candy with it)?
(i am newish to .net in general)
 
Of course i don't expect an exact answer or anything like that, but maybe there where some folks around with first hand experience with either this (or similar per pixel alpha blending) and wpf and could share a couple of lines regarding performance.
 
Thanks in advance!
GeneralRe: Thanks for new Version! Performance questions PinmemberJeff J Anderson6-Oct-09 5:14 
QuestionVery nice. Question do controls have to be placed on empty areas? PinmemberAbrojus30-Sep-09 2:50 
Basically wondering if controls have to always be placed in transparent areas marked with a AFMarker instead of, lets say, put a button straight on top of part of the image?
AnswerRe: Very nice. Question do controls have to be placed on empty areas? PinmemberJeff J Anderson30-Sep-09 16:54 
GeneralRe: Very nice. Question do controls have to be placed on empty areas? PinmemberAbrojus30-Sep-09 20:44 
GeneralGreat Work! PinmemberJason Song4-Sep-09 4:19 
That's what i'm looking for,thks!
QuestionHelp with animated GIF... PinmemberShinta^^4-Aug-09 19:55 
I'm trying to include an animated GIF in the form (for a splash screen).
The problem I'm facing is that the image is showed static (i.e. only the first frame).
 
Any suggestion?
 
Thanks Smile | :)
AnswerRe: Help with animated GIF... PinmemberJeff J Anderson6-Aug-09 13:17 
GeneralRe: Help with animated GIF... PinmemberShinta^^6-Aug-09 20:21 
GeneralRe: Help with animated GIF... PinmemberJeff J Anderson14-Aug-09 6:33 
GeneralWow! PinmvpDaveyM6919-Jul-09 22:55 
Excellent work Jeff. It's not very often that I look forward to studying someone elses code (or even mine!) - but I can't wait to get home tonight and have a good dig into this Big Grin | :-D
 
Nice one - gotta be worth a 5 minimum Thumbs Up | :thumbsup:
 
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralApplause for releasing 1.1 to CodeProject ! PinmemberBillWoodruff19-Jul-09 13:26 
Thank you, Jeff, very much, for bringing in the latest version here.
 
best, Bill
 
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844

GeneralToolTip PinmemberMember 424231224-Mar-09 9:52 
Great job, but it seems that the ToolTip stops working after I drag the form on the desktop. Is there some quick workaround?
Questionhiding the form? PinmemberDiamonddrake13-Jan-09 13:16 
when I use this, the form1.Visible = false; no longer hides the form, instead it hides just the controls on the form, the image for the background still stays. is there a way to show/hide the form completely via a method?
AnswerRe: hiding the form? PinmemberDiamonddrake16-Jan-09 10:23 
GeneralRe: hiding the form? PinmemberAbrojus30-Sep-09 15:04 
GeneralRe: hiding the form? PinmemberJeff J Anderson30-Sep-09 16:53 
GeneralRe: hiding the form? PinmemberDiamonddrake30-Sep-09 18:19 
GeneralRe: hiding the form? PinmemberAbrojus30-Sep-09 20:45 
GeneralRe: hiding the form? PinmemberJeff J Anderson5-Oct-09 5:54 
GeneralRe: hiding the form? PinmemberAbrojus5-Oct-09 8:13 
QuestionPainting on LayeredWindowForm Pinmemberjacobjordan22-Dec-08 12:56 
To start off, this is a great article. However, one limitation of your design that the application i'm making cannot handle is that there must be a transparent section in the bitmap with a marker (so you can see through to the actual form) to see and interact with the controls, however my application requires that the control be on the bitmap itself. I tried extracting the code for the LayeredWindowForm class out of your DLL and integrating it into my application, and then making a form inheriting from it and putting controls on it. However, the controls do not show after i call the SetBits method (i assume because they're being painted over). Is there any way i can add controls on (and paint on the graphics of) a form inheriting from LayeredWindowForm after the SetBits method has been called? Any suggestions are appreciated.
 
Giveaway of the day .com
------------------------------------------------------------------
Dream.In.Code | Programmer's Heaven | CodeGuru
"Failure is only the opportunity to begin again, this time more wisely."

QuestionFacing limitations in Flash.OCX to play swf files. PinmemberSharjeelHKhan2-Sep-08 18:45 
Hey, I have successfully used Flash.ocx control in C# to play SWF movie file but I have faced some limitations in it. I jumped to any specific frameNo by using gotoframe() method given in this control, It do jumped but the problem arise when I try to jump on frame which is greater than 12,500 i.e: It only understands starting 12,500 frames of the movie although it do play frame grater than 12,500 but the problem is to jump. Do anyone has idea about this problem.
 
Plus I also want to play the movie at 1/2X,2X,4X,... speed, Is it possible using this control or I should look for another and what should that ANOTHER(remember I need it on windows form).
 
regards.
GeneralVB2008- I got it, but ... Pinmemberdherrmann3-May-08 13:04 
Hallo,
I want to use this great idea in VB. I tried it to use it at an info-form. I wrote the following code in the forms code:
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
 
Partial Public Class frmCustomForm
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
 
Private Sub frmCustomForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AlphaFormTransformer1.TransformForm()
End Sub
 
Private Sub AlphaFormTransformer1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AlphaFormTransformer1.Click
Me.Close()
End Sub
End Class

frmCustomForm is my form, I have a fine picture made with Gimp as png.
When I start the project, a great custom form is shown!
But one thing functions not:
The Click on the AlphaFormTransformer...
 
What can it be?
 
Greetings from Austria
Dietrich
GeneralRe: VB2008- I got it, but ... PinmemberJeff J Anderson4-May-08 18:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130617.1 | Last Updated 5 Oct 2009
Article Copyright 2007 by Jeff J Anderson
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid