01.
If
File.Exists($
"IdBG\Member Picture\{rw.Item("
Code
")}.jpg"
)
Then
02.
Dim
ProPic
As
Image = CorectRotate(Image.FromFile($
"IdBG\Member Picture\{rw.Item("
Code
")}.jpg"
))
03.
Dim
x, y, rt
As
Double
04.
If
ProPic.Width < ProPic.Height
Then
05.
rt = 381 / ProPic.Width
06.
y = ((ProPic.Width * rt) - (456 * rt)) * (ProPic.Width / 381) / 2
07.
Else
08.
rt = 456 / ProPic.Height
09.
x = ((ProPic.Height * rt) - (381 * rt)) * (ProPic.Height / 456) / 2
10.
End
If
11.
tmpIm =
New
Bitmap(ProPic, ProPic.Width, ProPic.Height)
12.
grp.DrawImage(tmpIm,
New
Rectangle(61, 319, 381, 456),
New
Rectangle(x, y, ProPic.Width - (x * 2), ProPic.Height - (y * 2)), GraphicsUnit.Pixel)
13.
14.
End
If