pan zoom effect

Topics: Developer Forum, Project Management Forum, User Forum
Mar 8, 2016 at 11:17 PM
how to add pan zoom effect video
string[] resimlerx = Directory.GetFiles(TbResimYolu.Text, "*jpg");
            string[] filters = new[] { "*.jpg", "*.png"};
            string[] resimler = filters.SelectMany(f => Directory.GetFiles(TbResimYolu.Text, f)).ToArray();

            string[] muzikler = Directory.GetFiles(RbMuzikYol.Text, "*.mp3");
            int kacarli = Int32.Parse(TbKacarli.Text);
            int resimsayisi = resimler.Length;
            int muziksayisi = muzikler.Length;
            int kacvideo = resimsayisi / kacarli;

            using (ITimeline timeline = new DefaultTimeline())
            {

                double halfDuration = Convert.ToDouble(TbSure.Text);
                int x = 0;
                int x2 = 0;
                for (int i = 0; i < kacvideo; i++)
                {
                    IGroup group = timeline.AddVideoGroup(32, 1280, 720);//piksele göre
                    string kalite = CbKalite.SelectedText;
                    if (kalite == "1080")
                    {
                        group = timeline.AddVideoGroup(32, 1920, 1080);
                    }
                    else if (kalite == "720")
                    {
                        group = timeline.AddVideoGroup(32, 1280, 720);
                    }

                   
                    ITrack videoTrack = group.AddTrack();
                    IClip[] iclip = new IClip[kacarli + 1];
                    //grıp clip burada oluşmalı 2. defa ve sayısı kacarli + 1 olmalı
                    x2 = 0;//++
                    for (int i2 = 0; i2 < kacarli; i2++)
                    {
                        if (x2 == 0)
                        {
                            //siyah resim olustur ve ekle
                            string Baslik = getBaslik(TbResimYolu.Text);
                            string AltBaslik = TbAltBas.Text;
                            TextImageCreator tic = new TextImageCreator();
                            tic.CreateText(CbKalite.SelectedText, Baslik, AltBaslik);

                            iclip[i2] = videoTrack.AddImage(@"pictureCikti.bmp", 0, 2);
                            x2++;
                        }
                        else
                        {
                            
                            iclip[i2] = videoTrack.AddImage(resimler[x-1], 0, 2);
                            //add pan zoom effect how ?
                            Effect ef = new Effect();//
                            group.AddTransition(iclip[i2].Offset - halfDuration, halfDuration, StandardTransitions.CreateFade(), true);
                            group.AddTransition(iclip[i2].Offset, halfDuration, StandardTransitions.CreateFade(), false);
                        }
                        x++;

                    }
                    ITrack audioTrack = timeline.AddAudioGroup().AddTrack();

                    IClip audio = audioTrack.AddAudio(muzikler[i].ToString(), 0, videoTrack.Duration);
                    audioTrack.AddEffect(0, audio.Duration, StandardEffects.CreateAudioEnvelope(1.0, 1.0, 1.0, audio.Duration));
                    //değişcek
                    string isim = getBaslik(TbResimYolu.Text);
                    isim = isim + i.ToString() + ".wmv";
                    IRenderer renderer = new WindowsMediaRenderer(timeline,isim, WindowsMediaProfiles.HighQualityVideo);
                    renderer.Render();
                }
            }