C# winform写的播放器,歌词显示在桌面上的代码
请各位大哥大姐帮帮忙,有好的播放器更好,不过要有源代码,谢谢!
Rectangle rec = new Rectangle(0,0,100, 72);//0,0坐标,长100高72的矩形 private void button1_Click(object sender, EventArgs e) { Bitmap bmp=new Bitmap(this.Width,this.Height);//申请图片 Graphics myGraphics = Graphics.FromImage(bmp); GraphicsPath myGraphicsPath = new GraphicsPath();//声明路径myGraphicsPath FontFamily myFontFamily = new FontFamily("黑体"); Point myPoint = new Point(0, 0); StringFormat myStringFormat = new StringFormat(); myGraphicsPath.AddString("要取交集的文字",myFontFamily, 1, 72, myPoint, myStringFormat); Pen myPen = new Pen(Color.Red, 1); myGraphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;//反锯齿 myGraphics.DrawPath(myPen, myGraphicsPath); //绘制路径myGraphicsPath SolidBrush myBrash = new SolidBrush(Color.Red); Region re = new Region(rec);//声明Region对象并用rec初始化 re.Intersect(myGraphicsPath); //区交集 myGraphics.FillRegion(myBrash, re); ////用myBrash填充re的内部 this.CreateGraphics().DrawImage(bmp,0,0);//将内存中的图片显示出来 myGraphics.Dispose();//释放资源 }思路参看https://bbs.bccn.net/viewthread.php?tid=301169&page=1#pid1744818