faiksafa Posted January 4, 2011 Share Posted January 4, 2011 [b]Arkadaşlar benm yaptığım bir proje var.Bu projede ben bir yerden bir yere çizgi çizdirmek istiyorum.X ve Y koordinatlarını alarak bu konuda bana yardımcı olabilirseniz sevinirim... Birde bu koordinatlara aralık belirtebilirmiyiz.Mesela X1=100 ve 250 arası Y1=300 ile 150 arasında ise şunu yap die birşey yapabilirmiyiz...[/b] Quote Link to comment Share on other sites More sharing options...
galetis Posted January 4, 2011 Share Posted January 4, 2011 (edited) Çizgi çizmeyi bilmiyorum ama 2. sorunun cevabı If kontrolüyle yapılır.. [codebox] int x=105, y=250; if (x>100 & x<250 && y>150 & y<300) { 'Yapılacaklar... } [/codebox] Edited January 4, 2011 by galetis Quote Link to comment Share on other sites More sharing options...
faiksafa Posted January 4, 2011 Author Share Posted January 4, 2011 [b]Saol Dostum. Diğer sorununda cevabını bilen varsa söyleyebilirmi??[/b] Quote Link to comment Share on other sites More sharing options...
ilhan91 Posted January 7, 2011 Share Posted January 7, 2011 (edited) eğer hala sorunu çözmediysen... c# ta nasıl olur bilmem ama c de graphics.h ekledikten sonra line() fonksiyonunu kullanabilirsin. line(100,250,300,150); eğerki sen iki nokta arasına fonksiyon kullanmadan çizgi çizdirmek istiyorsan pixel atarak bu işi çözebilirsin . çizgi çizdirme algoritmaları ise şu adreste mevcut. buradan bakarak bişeyler yapabilirsin... http://www.cs.unc.edu/~mcmillan/comp136/Lecture6/Lines.html ama istersen sana hazır algoritmasını veriyim ..... a=fabs(x2-x1); b=fabs(y2-y1); if(a> m=a; else m=b; t=1/m; initwindow( 800,600, "ÇIZGI" ); for(t=1/m;t<1;t+=1/m){ x=x1+(x2-x1)*t; y=y1+(y2-y1)*t; putpixel(x,y,RED); } Edited January 7, 2011 by ilhan91 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.