This Demo show how to create shaped form and customized buttons using Region, GraphicsPath and picture control and using picture control to play animate pictures.
All the graphic is get from Microsoft Media Player and change the size that make the graphic files smaller.
The procedures:
im = new Bitmap("mediaPlayer.jpg"); private void Form_Paint(object sender, PaintEventArgs e){Graphics g = e.Graphics;Rectangle mainRect = new Rectangle(0, 0, 695, 278);Region mainRegion = new Region(mainRect);e.Graphics.SetClip(mainRegion, CombineMode.Replace);// Create a GraphicsPath object and add a curve.GraphicsPath myPath = new GraphicsPath();.........Region ExcludeRegion3 = new Region(myPath);e.Graphics.ExcludeClip(ExcludeRegion3);......e.Graphics.DrawImage(im, 0, 0, 495,278);// Reset clipping region to infinite.e.Graphics.ResetClip();}
Note: Keep all the graphics in the bin/debug directory.