问题:在播放的视频控件上叠加一个十字坐标

解决代码:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace WindowsApplication115
{
   
public partial class Form1 : Form
    {
       
public Form1()
        {
            InitializeComponent();

            GraphicsPath GP
= new GraphicsPath();
            GP.AddRectangle(
new Rectangle(0, 50 - 1, 100, 2));
            GP.AddRectangle(
new Rectangle(50 - 1, 0, 2, 100));

            Bitmap Bmp
= new Bitmap(100, 100);
           
using (Graphics G = Graphics.FromImage(Bmp))
                G.FillRectangle(Brushes.Red,
new Rectangle(0, 0, 100, 100));

            PictureBox PB
= new PictureBox();
            PB.Size
= new Size(100, 100);
            PB.Parent
= this;
            PB.Image
= Bmp;
            PB.Region
= new Region(GP);
            PB.Location
= new Point((this.Width - PB.Width) / 2, (this.Height - PB.Height) / 2);

     PB.BringToFront();
        }
    }
}

posted on 2009-11-30 14:51  forrestsun  阅读(195)  评论(0编辑  收藏  举报