Stretch video to dimensions of picturebox

This forum is about all development around libVLC.
antrikshdigisign
New Cone
New Cone
Posts: 2
Joined: 30 Dec 2009 07:29

Stretch video to dimensions of picturebox

Postby antrikshdigisign » 30 Dec 2009 08:05

hi
I am making a VLC streaming windows application with c#.NET using LibVLC.
I used a dot net wrapper.
I am projecting VLC's Vedio output to a picture box "pboxScreen"

My problem is that I want to stretch my video to dimensions of picture box.
I want my video to self-adjust and enlarge as to completely fit in the container(picturebox).

How can I do that?

here is the code that I am currently using:-

Code: Select all

IPAddress[] addresslist = Dns.GetHostAddresses(Dns.GetHostName()); vlc = new LibVlc(false, 5); pboxScreen.SizeMode = PictureBoxSizeMode.StretchImage; pboxScreen.Image = Image.FromFile("c:\\testerror.bmp"); vlc.Initialize(); vlc.VideoOutput = pboxScreen; string[] options = { ":sout=#transcode{vcodec=mp4v,vb=1024,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=display,dst=std{access=http,mux=ts,dst=" + addresslist[0].ToString() + ":" + txtPort.Text + "}}" }; vlc.Play();

I tried :-
pboxScreen.SizeMode = PictureBoxSizeMode.StretchImage;
but it didn't work! :(
I am a new to VLC development!
please help!

thank you

sincerely,

Antriksh Mathur

Aardvark Soup
New Cone
New Cone
Posts: 1
Joined: 07 Aug 2012 11:34

Re: Stretch video to dimensions of picturebox

Postby Aardvark Soup » 07 Aug 2012 11:37

My apologies for kicking this old post, but I have the exact same problem and was unable to find a solution anywhere.

Is it actually even possible to stretch a video to fit the window (or to stretch horizontally or vertically at all)?

EDIT: Solved it! It turns out you can simply specify an aspect ratio (libvlc_video_set_aspect_ratio) of "w:h" where w and h respectively are the width and height of your window.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 22 guests