locked
Store picture which is taken by webcam to a folder in vb RRS feed

  • Question

  • User538920519 posted

    hello everyone. i am very new in programming. i have been doing a project for my college and currently im stuck. i couldn't find a way to store the pictures that are taken using webcam to a folder. its more like i want to store the picture and then encrypt the folder. pls help me out. thanks.

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
    Dim data As IDataObject
    Dim bmap As Image

    '
    ' Copy image to clipboard
    '
    SendMessage(hHwnd, WM_CAP_EDIT_COPY, 0, 0)

    '
    ' Get image from clipboard and convert it to a bitmap
    '
    data = Clipboard.GetDataObject()
    If data.GetDataPresent(GetType(System.Drawing.Bitmap)) Then
    bmap = CType(data.GetData(GetType(System.Drawing.Bitmap)), Image)
    picCapture.Image = bmap
    ClosePreviewWindow()
    btnSave.Enabled = False
    btnStop.Enabled = False
    btnStart.Enabled = True

    If sfdImage.ShowDialog = DialogResult.OK Then
    bmap.Save(sfdImage.FileName, Imaging.ImageFormat.Bmp)
    End If

    End If
    End Sub

    Friday, April 13, 2012 5:02 PM

Answers