09-06-19, 08:13 PM
استبدل كود Button1 بـ :
PHP كود :
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim i1 As Decimal = TxtBrotin.Text
Dim i2 As Decimal = TxtKrpohidrat.Text
Dim i3 As Decimal = TxtDohon.Text
Dim total As Decimal = i1 + i2 + i3
Dim deg1 As Decimal = (i1 / total) * 360
Dim deg2 As Decimal = (i2 / total) * 360
Dim deg3 As Decimal = (i3 / total) * 360
Dim pen As New Pen(Color.Black, 2)
Dim Img0 As New Bitmap(PbChart_pic.Width, PbChart_pic.Height)
Dim graphics As Graphics = PbChart_pic.CreateGraphics()
Dim rect As New Rectangle(50, 25, 200, 200)
Dim brush1 As New SolidBrush(Color.Green)
Dim brush2 = New SolidBrush(Color.Yellow)
Dim brush3 = New SolidBrush(Color.Red)
Dim G As Graphics = graphics.FromImage(Img0)
G.Clear(PbChart_pic.BackColor)
G.FillPie(brush1, rect, 0, deg1)
G.FillPie(brush2, rect, deg1, deg2)
G.FillPie(brush3, rect, deg1 + deg2, deg3)
Dim ms As New MemoryStream
Img0.Save(ms, Imaging.ImageFormat.Png)
Img = ms.ToArray
PbChart_pic.Image = Image.FromStream(ms)
G.Dispose()
mytotal()
End Sub
سبحان الله وبحمده سبحان الله العظيم و الحمد لله ولا اله الا الله والله اكبر
