مرحبا ً بكـ يا زائر فى منتديات هم هم نتمنى لك قضاء اجمل الاوقات معنا
|
لجميع الاعضاء و الضيوف والزائرين ..مرحبا بكم أفرادا جددا في أسرتنا الكبيرة ....فلا تنسوا أن تسجلوا وبعد أن تقوموا بجولة بين حنايا صفحاتنا.. ندعوكم للمشاركة معنا في هذا الملتقى الجميل منتديات هم هم فور يو وإذا كنت لا تستطيع الإحساس بقيمة عملك كمبدع بيننا, فهل تعجز عن الشعور بقيمة وجودك كإنسان
فياترى هل تتمنى ان يكون لاسمك بيننا وجود؟؟؟ |
| | رسومات حاسوب ( pascal) | |
| | كاتب الموضوع | رسالة |
---|
البرفسير مالك ومؤسس هم هم
الجنسيه : الشرقية المشاركات : 4904 العمر : 33 التعليم : جامعي تاريخ الانتساب : 07/08/2008 نقاط : 8907
| موضوع: رسومات حاسوب ( pascal) الثلاثاء 25 أغسطس 2009 - 15:23 | |
| Computer graphics * spheres of computer : Didactic – crafting – health – space. * pixel" it's photic unit . Putpixel (x,y, color ) ; Example: Program test; Uses graph; Var i,gd,gm:integer; Begin Initgraph( gd,gm,'c:\\\\tp\\\\bgi'); Gd:=detect; For i:=100 to 200 do Putpixel( i,250,5); Readln; Closegraph; End. ********************************************** Example1: Program test; Uses graph; Var I,gd,gm:integer; Begin Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Gd:= detect; For i:= 200 to 400 do Putpixel( i,250,9); For i:= 200 to 400 do Putpixel(i,438,9); For i:= 250 to 438 do Putpixel( 200,i,9); For i:= 250 to 438 do Putpixel( 400, i,9); Readln; Closegraph; End. ************************************************ Example 2: Program test; Uses graph; Var i,gd,gm:integer; Begin Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Gd:= detect; For i:= 200 to 400 do Begin Putpixel(i,200,8); Putpixel(i,400,7); Putpixel(200,i,5); Putpixel(400,i,10); End; Readln; Closegraph; End. Example 3: Program test; Uses graph; Var i,gd,gm:integer; Begin Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Gd:= detect; For i:= 100 to 300 do Begin Putpixel(i,80,5); Putpixel(i,280,5); End; For i:= 80 to 280 do Begin Putpixel(100,i,5); Putpixel(300,i,5); End; Gd:= 301; For i:= 81 to 179 do Begin Putpixel(x,i,5); X:= x+1; End; For i:= 181 to 280 do Begin Putpixel(x,i,5); X:= x-1; End; Readln; Closegraph; End. Example 4: Program test; Uses graph; Var i,gd,gm:integer; Begin Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Gd:= detect; For i:= 100 to 300 do Begin Putpixel(i,80,5); Putpixel(i,280,5); End; For i:= 80 to 280 do Begin Putpixel(100,i,5); Putpixel(300,i,5); End; Gd:= 301; For i:= 81 to 179 do Begin Putpixel(x,i,5); X:= x+1; End; For i:= 180 to 280 do Begin Putpixel( x,i,5); X:= x-1; End; Y:= 81; For i:= 299 downto 101 do Begin Putpixel( i,y,9); Y:= y+1; End; Readln; Closegraph; End. ************************************************ Example 5: Program test; Uses graph; Var i,x,y:integer; Begin Initgraph(x,y,'c:\\\\tp\\\\bgi'); X:=detect; For i:= 100 to 300 do Begin Putpixel(i,80,5); Putpixel(i,280,5); End; For i:= 80 to 280 do Begin Putpixel(100,i,5); Putpixel(300,i,5); End; X:= 301; For i:= 81 to 179 do Begin Putpixel(x,i,5); X:= x+1; End; For i:= 180 to 280 do Begin Putpixel(x,i,5); X:= x-1; End; begin For y:= 81 to 279 do For i:= 299 to 101 do Putpixel(i,y,9); Y:=y+1; End; Readln; Closegraph; End. ************************************************ circle that complete curve from 0 to 360 . circle ( X,Y,R) ; الشكل العام لهذا الإجراء example 6: program test; uses graph; var gd,gm:integer; begin gd:= detect; initgraph(gd,gm,'c:\\\\tp\\\\bgi'); setcolor(4); circle(100,150,60); readln; closegraph; end. ***************************************** Example 7: Program test; Uses graph; Var i,gd,gm:integer; Begin Gd:= detect; Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Setcolor(4); Circle(100,150,60); For i:= 41 to 159 do Putpixel(i,150,7); For i:= 91 to 209 do Putpixel(100,i,4); Readln; Closegraph; End. ***************************************** ARC It use to drawing parts of circle. In gerenal " Arc (x,y,start angle,end angle,r); Example 8 : Program test; Uses graph; Var gd,gm:integer; Begin Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Gd:= detect; Setcolor(6); Arc(100,200,0,180,60); Readln; Closegraph; End. ***************************************** Example 9 : Program test; Uses graph; Var i,gd,gm:integer; Begin Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Gd:= detect; Arc(100,200,0,180,60); For i:= 40 to 160 do Putpixel(i,200,5); For i:= 40 to 160 do Putpixel(i,210,6); Arc(100,210,180,360,60); For i:= 200 to 350 do Putpixel(100,i,62); Arc(70,350,180,360,30); For i:= 1 to 60 do Arc(100,210,180,270,i); Readln; Closegraph; End. ***************************************** Line It use to drawing the lane. In gerenal " Line(x1,y1,x2,y2);
70 100 For i:= 70 to 100 do 60,2);(i, putpixel 60 Setcolor(2); Line(70,60,100,60); يتبع | |
| | | البرفسير مالك ومؤسس هم هم
الجنسيه : الشرقية المشاركات : 4904 العمر : 33 التعليم : جامعي تاريخ الانتساب : 07/08/2008 نقاط : 8907
| موضوع: رد: رسومات حاسوب ( pascal) الثلاثاء 25 أغسطس 2009 - 15:26 | |
| Example 10 : Program test; Uses graph; Var gd,gm:integer; Begin Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Gd:= detect; Setcolor(5); Line(150,150,250,150); Line(150,250,150,150); Line(250,250,150,250); Line(250,250,250,150); Arc(200,150,0,180,50); Arc(200,250,180,360,50); Arc(250,200,270,90,50); Arc(150,200,90,270,50); Readln; Closegraph; end Linerel وهو اجراء لرسم خط مستقيم بشرط ان نجمع قيمته مع قيمة moveto الشكل العام : Linerel ( X,Y) ; EX 11: Program test; Uses graph ; crt ; Var gd,gm,i: integer; Begin Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Gd:= detect; Setcolor(1); Moveto(100,100); تحديد نقطة بداية المؤشر For i:= 0 to 200 do Begin Setcolor( random(16)); Lineto(i,0); Linerel(0,i); Linerel(-i,0); Linerel(0,-i); Delay(1000); End; Readln; Closegraph; End. rectangle يستخدم هذا الإجراء فى رسم مربع او مستطيل حسب الابعاد . الشكل العام لهذا الإجراء : Rectangle( X1,Y1,X2,Y2) ; EX12: Program test; Uses graph ; crt ; Var gd,gm,i: integer; Begin Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Gd:= detect; Setcolor(5); Rectangle( 10,100,300,310); i:= 300; i:= I -1 ; setcolor(9); for i:= i downto 11 do rectangle( i,101,i,309); readln; closegraph; end. BAR يستخدم لرسم مستطيل او مربع ممتلئ . بعد تحديد نقطة البداية و النهاية , ونستطيع تحديد نوع النقش ولون الـ ( bar ) بأستخدام هذا الإجراء. الشكل العام لهذا الاجراء : Bar ( X1,Y1,X2,Y2) ; Ex 13: Program test; Uses graph ; crt ; Var gd,gm,i: integer; Begin Initgraph(gd,gm,'c:\\\\tp\\\\bgi'); Gd:= detect; Setfillstyle(1,4); Bar( 10,20,100,300); readln; closegraph; end. ellipse يستخدم هذا الإجراء فى رسم قطع ناقص . وذلك بتحديد المركز و الزاوية البداية و النهاية ونصف القطر لكلا الناحيتين ( X,Y ) . والصيغة العامة لها هى: Ellipse( x,y,startangle,endangle,x radius,y radius); X radius Y radiu Ex 14: Program test; Uses graph ; crt ; Var gd,gm,i: integer; Begin Initgraph(gd,gm,'c:\\tp\\bgi'); Gd:= detect; Setcolor(5); Ellipse(100,100,0,360,40,60); readln; end. pieslice يستخدم هذا الإجراء فى رسم شكل دائرة ( شكل الفطيرة ) ممتلئة وذلك بعد تحديد المركز X,Y وزاوية البداية والنهاية ونصف القطر . الشكل العام لهذا الإجراء : Pieslice ( x,y,startangle,endangle,r ) ; مثـــــــــال : Pieslice ( 100,150,0,270,60) ; للالوان نستخدم setfillstyle ( pattorn,color ) ; لون نقش بالنسبة للخط الخارجى setcolor . Outtext يستخدم هذا الإجراء لكتابة نص . وهو متبوع بجملة moveto . الشكل العام لهذا الإجراء : Outtext ( ' النص المراد كتابتة ' ) ; Ex 15: Program test; Uses graph ; crt ; Var gd,gm,i: integer; Begin Initgraph(gd,gm,'c:\\tp\\bgi'); Gd:= detect ; Moveto ( 200,250); اللون نوع الخط Setstyletext( 1, horizental,3) ; Outtext ( ' AHMEED ') ; Readln ; Closegraph;end . Lineto يستخدم هذا الإجراء لرسم خط مستقيم بشرط ان يبدأ من نقطة الـ moveto . الشكل العام اهذا الإجراء : Lineto ( X,Y ) ; Ex 16: Program test; Uses graph ; crt ; Var gd,gm,i: integer; Begin Initgraph(gd,gm,'c:\\tp\\bgi'); Gd:= detect ; Moveto ( 200,250); Lineto ( 300,100) ; Readln ; Closegraph; End. | |
| | | | رسومات حاسوب ( pascal) | |
|
| صلاحيات هذا المنتدى: | لاتستطيع الرد على المواضيع في هذا المنتدى
| |
| |
| |
|