Windows Forms 응용 프로그램이 있고 SQL 서버 데이터베이스에 스크린 샷을 저장하고 싶습니다. 지금까지 내 코드는 다음과 같습니다.
Dim bounds As Rectangle = CaptureBox.Bounds
Dim pt As Point = CaptureBox.PointToScreen(bounds.Location)
Dim bitmap As New Bitmap(bounds.Width, bounds.Height)
Using g As Graphics = Graphics.FromImage(bitmap)
g.CopyFromScreen(New Point(pt.X - CaptureBox.Location.X, pt.Y - CaptureBox.Location.Y), Point.Empty, bounds.Size)
End Using
Dim bytes() As Byte
Dim converter As New ImageConverter()
bytes = converter.ConvertTo(bitmap, GetType(Byte()))
SQL
, 포인터를 삽입하는 데 도움이 필요 합니까?
SQL 테이블과 이미지 유형의 열을 만들기 만하면됩니다. 그냥 바이트로 삽입 할 수 있습니다.
이미지를로드하려면 해당 열에서 바이트를 읽습니다.
Dim imgBytes() As Bytes = reader(0) 'contains bytes from image column
Dim memStr As New MemoryStream(imgBytes)
imageBox.Image = Image.FromStream(memStr)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다