Putpixel Fonksiyonu ile Köşegen Çizmek

Bu dersimizde c++ Putpixel Fonksiyonunun nasıl kullanıldığını öğreneceğiz. Aşağıdaki örnekte Putpixel Fonksiyonu ile Köşegen Çizme konusu işlenmiştir.

#include <stdio.h>
#include <conio.h>
#include <graphics.h>
#include <dos.h>

int main()
{
	int gdriver=DETECT,gmode;
        float a,b;

	initgraph(&gdriver,&gmode,"");

       for(a=0,b=0;a<getmaxx(),b<getmaxy();a+=0.2,b+=0.2){
            putpixel(4.0*a,3.0*b,2);
}

	getch();
	closegraph();
}

Yorum Yaz