I need when save picture type date and time now on it and save with date and time stamp from picture box visualbasic

Viewed 42

I need when save picture from picture box write date and time now on it picture itself and save with this stamp visualbasic

    Dim data As IDataObject
    Dim bmap As Image
    '  Dim g As Graphics = picCapture.CreateGraphics()
    ' g.DrawString("SAVED ON - " & Now, New Font("Arial", 18), Brushes.Yellow, 10, 10)

    ' 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

        PictureBox1.Image = picCapture.Image


        sfdImage.FileName = TextBox1.Text

        SendKeys.Send("{Enter}")

        If sfdImage.ShowDialog = DialogResult.OK Then

            If InStr(sfdImage.FileName, ".bmp") Then

                bmap.Save(sfdImage.FileName, Imaging.ImageFormat.Bmp)

            Else
                bmap.Save(sfdImage.FileName, Imaging.ImageFormat.Jpeg)

                'SendKeys.Send("{Enter}")
                TextBox1.Clear()
                TextBox1.Focus()
            End If
        End If
    End If
End Sub
0 Answers
Related