تبلیغات
حرفای نگفته ی من - 29آبان
 

29آبان

نوشته شده توسط :سولیست سولی
شنبه 9 بهمن 1389-07:06 ب.ظ

P1x = 50

P1y = 50

P2x = 100

P2y = 50

P3x = 100

P3y = 100

P4x = 50

P4y = 100

GraphicsWindow.Show()

'------------------------- Khat 1

x1 = P1x

y1 = P1y

x2 = P2x

y2 = P2y

DDA()

'------------------------- Khat 2

x1 = P2x

y1 = P2y

x2 = P3x

y2 = P3y

DDA()

'------------------------- Khat 3

x1 = P3x

y1 = P3y

x2 = P4x

y2 = P4y

DDA()

'------------------------- Khat 4

x1 = P4x

y1 = P4y

x2 = P1x

y2 = P1y

DDA()

'------------------------ Fill

fcolor = "#FF0000"

bcolor = "#0000FF"

Stack.PushValue("x", 75)

Stack.PushValue("y", 75)

Fill()

Sub DDA

dx = x2 - x1

dy = y2 - y1

If Math.Abs(dx) > Math.Abs(dy) Then

steps = Math.Abs(dx)

Else

steps = Math.Abs(dy)

EndIf

xinc = dx / steps

yinc = dy / steps

x = x1

y = y1

GraphicsWindow.SetPixel(Math.Round(x), Math.Round(y), "Blue")

For i = 0 To steps

x = x + xinc

y = y + yinc

GraphicsWindow.SetPixel(Math.Round(x), Math.Round(y), "Blue")

EndFor

'GraphicsWindow.BrushColor = "Red"

'GraphicsWindow.DrawText(x1, y1, "(" + x1 + "," + y1 + ")")

'GraphicsWindow.DrawText(x2, y2, "(" + x2 + "," + y2 + ")")

EndSub

 

Sub Fill

While Stack.GetCount("x") > 0

x = Stack.PopValue("x")

y = Stack.PopValue("y")

color = GraphicsWindow.GetPixel(x,y)

If (color <> bcolor And color <> fcolor) Then

GraphicsWindow.SetPixel(x,y, fcolor)

Stack.PushValue("x", x)

Stack.PushValue("y", y + 1)

Stack.PushValue("x", x + 1)

Stack.PushValue("y", y)

Stack.PushValue("x", x)

Stack.PushValue("y", y - 1)

Stack.PushValue("x", x - 1)

Stack.PushValue("y", y)

EndIf

EndWhile

EndSub





نظرات() 


What is the tendon at the back of your ankle?
شنبه 18 شهریور 1396 04:51 ق.ظ
What i don't realize is in reality how you're not actually
much more neatly-favored than you may be right now.

You are very intelligent. You recognize therefore considerably
in the case of this matter, made me for my part imagine it from so many varied angles.
Its like men and women are not fascinated until it is one thing to do with
Girl gaga! Your individual stuffs great. At all times handle it up!
What is a heel lift?
دوشنبه 30 مرداد 1396 10:32 ق.ظ
I do not even know how I ended up here, but I thought this post
was good. I don't know who you are but definitely you are going to a famous blogger if you are not already ;) Cheers!
Why is my Achilles tendon burning?
سه شنبه 17 مرداد 1396 10:17 ق.ظ
Asking questions are genuinely nice thing if you are not understanding something totally, except this post
offers fastidious understanding yet.
Foot Pain
شنبه 14 مرداد 1396 11:56 ب.ظ
I was able to find good info from your articles.
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر


درباره وبلاگ:



آرشیو:


طبقه بندی:


آخرین پستها:


پیوندها:


نویسندگان:


ابر برچسبها:


آمار وبلاگ:







The Theme Being Used Is MihanBlog Created By ThemeBox