Reduce the size of pic taken through webcam using WIA
<p>Hi i am taking pic through WIA using webcam in my application and storing in a picture box. From picture box after i click insert it will insert into dabase. But the picture size is too large to display in the picture box. How can i reduce the size of picture which i am capturing. Below is the code which i am using to capture a pic through WIA.</p>

<pre><code>private void menuFileAcquire_Click(object sender, EventArgs e)
    {
        WiaClass wiaManager = null;     // WIA manager COM object
        CollectionClass wiaDevs = null;     // WIA devices collection COM object
        ItemClass wiaRoot = null;       // WIA root device COM object
        CollectionClass wiaPics = null;     // WIA collection COM object
        ItemClass wiaItem = null;       // WIA image COM object

        try
        {
            wiaManager = new WiaClass();        // create COM instance of WIA manager

            wiaDevs = wiaManager.Devices as CollectionClass;            // call Wia.Devices to get all devices
            if ((wiaDevs == null) || (wiaDevs.Count == 0))
            {
                MessageBox.Show(this, "No WIA devices found!", "WIA", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                Application.Exit();
                return;
            }

            object selectUsingUI = System.Reflection.Missing.Value;         // = Nothing
            wiaRoot = (ItemClass)wiaManager.Create(ref selectUsingUI);  // let user select device
            if (wiaRoot == null)                                            // nothing to do
                return;

            // this call shows the common WIA dialog to let the user select a picture:
            wiaPics = wiaRoot.GetItemsFromUI(WiaFlag.SingleImage, WiaIntent.ImageTypeColor) as CollectionClass;
            if (wiaPics == null)
                return;

            bool takeFirst = true;                      // this sample uses only one single picture
            foreach (object wiaObj in wiaPics)          // enumerate all the pictures the user selected
            {
                if (takeFirst)
                {
                    DisposeImage();                     // remove previous picture
                    wiaItem = (ItemClass)Marshal.CreateWrapperOfType(wiaObj, typeof(ItemClass));
                    imageFileName = Path.GetTempFileName();             // create temporary file for image
                    Cursor.Current = Cursors.WaitCursor;                // could take some time
                    this.Refresh();
                    wiaItem.Transfer(imageFileName, false);         // transfer picture to our temporary file
                    pbPhoto.Image = Image.FromFile(imageFileName);  // create Image instance from file
                    menuFileSaveAs.Enabled = true;                      // enable "Save as" menu entry
                    takeFirst = false;                                  // first and only one done.
                }
                Marshal.ReleaseComObject(wiaObj);                   // release enumerated COM object
            }
        }
        catch (Exception ee)
        {
            MessageBox.Show(this, "Acquire from WIA Imaging failed\r\n" + ee.Message, "WIA", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            Application.Exit();
        }
        finally
        {
            if (wiaItem != null)
                Marshal.ReleaseComObject(wiaItem);      // release WIA image COM object
            if (wiaPics != null)
                Marshal.ReleaseComObject(wiaPics);      // release WIA collection COM object
            if (wiaRoot != null)
                Marshal.ReleaseComObject(wiaRoot);      // release WIA root device COM object
            if (wiaDevs != null)
                Marshal.ReleaseComObject(wiaDevs);      // release WIA devices collection COM object
            if (wiaManager != null)
                Marshal.ReleaseComObject(wiaManager);       // release WIA manager COM object
            Cursor.Current = Cursors.Default;               // restore cursor
        }


    }
</code></pre>

<p>Please Help me out</p>
