C de nesnelein içini doldurma

Bu başlık kilitlidir. Yeni mesajlar gönderilemez veya mevcut mesajlar düzenlenemez.
gmax136
15-03-2005, 11:20   |  #1  
OP Yıllanmış Üye
Teşekkür Sayısı: 0
108 mesaj
Kayıt Tarihi:Kayıt: Mar 2005

C de nesnelein içini doldurma örneğin karenin içini nasıl doldurcam?
ve arkaplan rengini nasıl değiştircem.Ayrıca getimage() hakkında birazcık bilgi istiyorum

Son Düzenleme: gmax136 ~ 15 Mart 2005 17:08
metallium
28-03-2005, 20:16   |  #2  
Taze Üye
Teşekkür Sayısı: 0
1 mesaj
Kayıt Tarihi:Kayıt: Mar 2005

setfillstyle belki isini görür

#include <graphics.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <conio.h>

/* the names of the fill styles supported */
char *fname[] = { "EMPTY_FILL",
                  "SOLID_FILL",
                  "LINE_FILL",
                  "LTSLASH_FILL",
                  "SLASH_FILL",
                  "BKSLASH_FILL",
                  "LTBKSLASH_FILL",
                  "HATCH_FILL",
                  "XHATCH_FILL",
                  "INTERLEAVE_FILL",
                  "WIDE_DOT_FILL",
                  "CLOSE_DOT_FILL",
                  "USER_FILL"
                };

int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   int style, midx, midy;
   char stylestr[40];

   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "c:\\tc\\bgi");

   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk)  /* an error occurred */
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1); /* terminate with an error code */
   }

   midx = getmaxx() / 2;
   midy = getmaxy() / 2;

   for (style = EMPTY_FILL; style < USER_FILL; style++)
   {
      /* select the fill style */
      setfillstyle(style, getmaxcolor());

      /* convert style into a string */
      strcpy(stylestr, fname[style]);

      /* fill a bar */
      bar3d(0, 0, midx-10, midy, 0, 0);

      /* output a message */
      outtextxy(midx, midy, stylestr);

      /* wait for a key */
      getch();
      cleardevice();
   }

   /* clean up */
   getch();
   closegraph();
   return 0;
}


t3chNo
04-03-2006, 14:20   |  #3  
Taze Üye
Teşekkür Sayısı: 0
11 mesaj
Kayıt Tarihi:Kayıt: Mar 2006

setfillstyle herhangi bir seklin icini doldurma seklini belirler sadece, o seklin icini doldurmaz. o sekli floodfill fonksiyonu ile doldurabilirsiniz. ustelik sekil onemli deildir onemli olan kapalı bir sekil olmasıdır.
kullanımı kısaca:

    setcolor(karenin_rengi);
    rectangle(50,50,100,100);
    setfillstyle(renk,doldurma_sekli);
    floodfill(55,55,karenin_rengi); //floodfill fonksiyonuna karenin icindeki herhangi noktayı ve hangi renge gelene kadar boyayacagını belirtmen gerek.

kolay gelsin..

Son Düzenleme: t3chNo ~ 04 Mart 2006 14:21
gmax136
05-03-2006, 00:08   |  #4  
OP Yıllanmış Üye
Teşekkür Sayısı: 0
108 mesaj
Kayıt Tarihi:Kayıt: Mar 2005

abicim eskide yaa :D taa 1 yil onceki baslik :D