tags:

views:

94

answers:

1

Point out my Error

am doing some video process

am render my video in a Picturebox.... here my problem is if i resize the picturebox i need to resize video also .

[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
    public static extern bool SetWindowPos(IntPtr hWnd, string hWndInsertAfter, int x, int Y, int cx, int cy, uint wFlags);

this is code am using for resize my player like

const uint SWP_NOMOVE = 0X2;
            const uint SWP_NOSIZE = 1;
            const uint SWP_NOZORDER = 0X4;
            const uint SWP_SHOWWINDOW = 0x0040;
            const UInt32 SWP_SHOWWINDOWS = 64;
    SetWindowPos(ptr, null, 0, 0, pictureBox1.Width, pictureBox1.Height, SWP_NOZORDER | SWP_NOMOVE);

ptr-> this is players handle which will added in picturebox

here my player getting resized and am manully change the pictureBox size. but in player it getting resized and it's render the video in correct size which i gave .but in pictureBox it's show in initial place only it's not getting resized ... please point out my error... thanks in advance

i belive here it's have some mismatch problem between picturebox and player window....

+1  A: 

You need to set PictureBoxSizeMode and use the ClientSize property to resize it.

atomice
can u give a example please
RV
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
atomice
ya already i have given this but it's not working man... do u have any other idea
RV
What are you using for the video player?
atomice
am import some dll for create an player[DllImport("PlayerLib")] public static extern int CreatePlayer(IntPtr Handle, ref Rectangle RECT, StringBuilder szWndTitle);it ll return the some ref no using this i can handle this playerto resize the player i ll use this function to find the plaer handle [DllImport("PlayerLib")] public static extern IntPtr GetPlayerDisplayHWND(int iPlayerRef);
RV