using (SqlConnection myDatabaseConnection = new SqlConnection(myConnectionString.ConnectionString))
{
myDatabaseConnection.Open();
using (SqlCommand SqlComma
I have routine in VB ..
but you should have 2 pictureboxes .. 1 for frame .. 1 for the image .. and it make keep the picture's size ratio
Assumed picFrame is the image frame and picImg is the image
Sub InsertPicture(ByVal oImg As Image)
Dim oFoto As Image
Dim x, y As Integer
oFoto = oImg
picImg.Visible = False
picImg.Width = picFrame.Width - 2
picImg.Height = picFrame.Height - 2
picImg.Location = New Point(1, 1)
SetPicture(picPreview, oFoto)
x = (picImg.Width - picFrame.Width) / 2
y = (picImg.Height - picFrame.Height) / 2
picImg.Location = New Point(x, y)
picImg.Visible = True
End Sub
I'm sure you can make it as C# ....