Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Make text effect (Karaoke effect) simalar this video
Happy new year
Posted
Updated 26-Feb-17 0:08am

Let me Google[^] that for you!
 
Share this answer
 
Maybe this will be helpfull for you:


using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace KaraokeEditor
{
    public class KaraokeDrawer
    {
        PictureBox _pBox;
        public KaraokeDrawer(PictureBox pBox)
        {
            _pBox = pBox;
            _pBox.Paint += pictureBox1_Paint;
            _timer.Tick += Timer_Tick;
            _timer.Start();
        }

        Timer _timer = new Timer() {Enabled = true, Interval = 50};
        
        private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {
            string text = "Hello World!";
            var path = new GraphicsPath();
            path.AddString(text, new FontFamily("Arial"), (int)FontStyle.Regular, 50, new Point(10, 10), StringFormat.GenericDefault);
            e.Graphics.FillPath(new SolidBrush(Color.White), path);

            Region r = new Region(path);
            RectangleF rect = r.GetBounds(e.Graphics);
            RectangleF intersectRect = new RectangleF(rect.X, rect.Y, rect.Width * _percent / 100, rect.Height);
            r.Intersect(intersectRect);
            e.Graphics.FillRegion(Brushes.Red, r);

            e.Graphics.DrawPath(new Pen(Color.Blue), path);
        }
        

        int _percent = 0;
        private void Timer_Tick(object sender, EventArgs e)
        {
            ++_percent;
            _pBox.Invalidate();
            if (_percent >= 100)
            {
                _timer.Stop();
            }

        }
    }
}
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900