View Single Post
  #3 (permalink)  
Old January 7th, 2012, 11:29 AM
Gary108 Gary108 is offline
Authorized User
Points: 193, Level: 3
Points: 193, Level: 3 Points: 193, Level: 3 Points: 193, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 31
Thanks: 6
Thanked 0 Times in 0 Posts
Question

Private Sub btnScale_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnScale.Click
' Get the scale factor.
Dim scale_factor As Single = Single.Parse(txtScale.Text)

' Get the source bitmap.
Dim bm_source As New Bitmap(picSource.Image)

' Make a bitmap for the result.

Dear Rob,
Thank you for your reply. I am still having some trouble with the following code. What does "Clnt" refer to? It seems that it would refer to the name or a bitmap but so far I cannot figure how to use it? I downloaded the example but when I tried to open the individual files so I could find an answer, it is prompting me to run some kind of conversion software. Any help you can give me, I will really appreciate.

Regards,


Gary




Dim bm_dest As New Bitmap( _
CInt(bm_source.Width * scale_factor), _
CInt(bm_source.Height * scale_factor))

' Make a Graphics object for the result Bitmap.
Dim gr_dest As Graphics = Graphics.FromImage(bm_dest)

' Copy the source image into the destination bitmap.
gr_dest.DrawImage(bm_source, 0, 0, _
bm_dest.Width + 1, _
bm_dest.Height + 1)

' Display the result.
picDest.Image = bm_dest
End Sub
Reply With Quote