getWaveImg() public method

public getWaveImg ( string filename ) : Bitmap
filename string
return System.Drawing.Bitmap
Ejemplo n.º 1
0
        private void DrawWaveform(
            Graphics g,
            VidkaProj proj,
            VidkaFileMapping projMapping,
            VidkaClipVideo vclip,
            int x1, int y1, int clipw, int cliph,
            double secStart, double secEnd)
        {
            // TODO: tmp!!! please use a cache or something u idiot, dont read the f*****g file on every paint
            string waveFile = projMapping.AddGetWaveFilenameJpg(vclip.FileName);

            if (File.Exists(waveFile))
            {
                Bitmap bmpWave = imgCache.getWaveImg(waveFile);                         //Image ot
                var    xSrc1   = (int)(bmpWave.Width * secStart / vclip.FileLengthSec); //TODO: this
                var    xSrc2   = (int)(bmpWave.Width * secEnd / vclip.FileLengthSec);
                srcRect.X       = xSrc1;
                srcRect.Width   = xSrc2 - xSrc1;
                srcRect.Y       = 0;
                srcRect.Height  = bmpWave.Height;                //TODO: use constant from Ops
                destRect.X      = x1;
                destRect.Y      = y1;
                destRect.Width  = clipw;
                destRect.Height = cliph;
                g.DrawImage(bmpWave, destRect: destRect, srcRect: srcRect, srcUnit: GraphicsUnit.Pixel);
            }
        }