ændre tal fra % til decimal
Hej jeg vil gerne vide om man enten kan få en knap man sætter til at få txtScale.text % tal til decimal tal feks 90 - 0,9 eller om man kan få det her til at være procent istedet for tal/decimaltal: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(PictureBox1.BackgroundImage)
' Make a bitmap for the result.
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.
PictureBox1.BackgroundImage = bm_dest
End Sub
på forhånd tak :)