duci.ro FORUM at forumco.com
duci.ro FORUM at forumco.com
Home | Profile | Register | Active Topics | Active Polls | Members | Private Messages | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?




 All Forums
 ProgrammingPool environment
 Functii grafice WinBGI (Pascal, C )
 Lista functiilor WinBGI
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Previous Topic Topic   

duci
Forum Admin


210 Posts

Posted - 08/07/2005 :  10:02:10  Show Profile  Email Poster Send duci a Private Message
Lista functiilor WinBGI
(dupa You must be logged in to see this link.)


void arc (int x, int y, int stangle, int endangle, int radius);
void bar (int left, int top, int right, int bottom);
void bar3d (int left, int top, int right, int bottom, int depth, int topflag);
void circle (int x, int y, int radius);
void cleardevice (void);
void clearmouseclick(int kind);
void clearviewport (void);
void closegraph (void);
void delay (int millisec);
void detectgraph (int *graphdriver, int *graphmode);
void drawpoly (int numpoints, int *polypoints);
void ellipse (int x, int y, int stangle, int endangle, int xradius, int yradius);
void fillellipse (int x, int y, int xradius, int yradius);
void fillpoly (int numpoints, int *polypoints);
void floodfill (int x, int y, int border);
int getactivepage (void);
void getarccoords (struct arccoordstype *arccoords);
void getaspectratio (int *xasp, int *yasp);
int getbkcolor (void);
int getch (void);
int getcolor (void);
struct palettetype* getdefaultpalette (void);
char* getdrivername (void);
void getfillpattern (char *pattern);
void getfillsettings (struct fillsettingstype *fillinfo);
int getgraphmode (void);
void getimage (int left, int top, int right, int bottom, void *bitmap);
void getlinesettings (struct linesettingstype *lineinfo);
int getmaxcolor (void);
int getmaxmode (void);
int getmaxx (void);
int getmaxy (void);
char* getmodename (int mode_number);
void getmoderange (int graphdriver, int *lomode, int *himode);
void getmouseclick(int kind, int& x, int& y);
void getpalette (struct palettetype *palette);
int getpalettesize (void);
unsigned getpixel (int x, int y);
void gettextsettings (struct textsettingstype *texttypeinfo);
void getviewsettings (struct viewporttype *viewport);
int getvisualpage (void);
int getx (void);
int gety (void);
void graphdefaults (void);
char* grapherrormsg (int errorcode);
int graphresult(void);
unsigned imagesize (int left, int top, int right, int bottom);
void initgraph (int *graphdriver, int *graphmode, char *pathtodriver);
void initwindow (int width, int height);
int installuserdriver (char *name, int huge (*detect)(void));
int installuserfont (char *name);
bool ismouseclick(int kind);
int kbhit (void);
void line (int x1, int y1, int x2, int y2);
void linerel (int dx, int dy);
void lineto (int x, int y);
int mousex (void);
int mousey (void);
void moverel (int dx, int dy);
void moveto (int x, int y);
void outtext (char *textstring);
void outtextxy (int x, int y, char *textstring);
void pieslice (int x, int y, int stangle, int endangle, int radius);
void putimage (int left, int top, void *bitmap, int op);
void putpixel (int x, int y, int color);
void rectangle (int left, int top, int right, int bottom);
int registerbgidriver (void (*driver)(void));
int registerbgifont (void (*font)(void));
void registermousehandler (int kind, void h(int, int));
void restorecrtmode (void);
RGB macros:
COLOR(r,g,b),
RED_VALUE(v), GREEN_VALUE(v), BLUE_VALUE(v),
IS_BGI_COLOR(v), IS_RGB_COLOR(v)
void sector (int x, int y, int stangle, int endangle, int xradius, int yradius);
void setactivepage (int page);
void setallpalette (struct palettetype *palette);
void setaspectratio (int xasp, int yasp);
void setbkcolor (int color);
void setcolor (int color);
void setfillpattern (char *upattern, int color);
void setfillstyle (int pattern, int color);
unsigned setgraphbufsize (unsigned bufsize);
void setgraphmode (int mode);
void setlinestyle (int linestyle, unsigned upattern, int thickness);
void setpalette (int colornum, int color);
void setrgbpalette (int colornum, int red, int green, int blue);
void settextjustify (int horiz, int vert);
void settextstyle (int font, int direction, int charsize);
void setusercharsize (int multx, int divx, int multy, int divy);
void setviewport (int left, int top, int right, int bottom, int clip);
void setvisualpage (int page);
void setwritemodesetwritemode(int mode);
int textheight (char *textstring);
int textwidth (char *textstring);

Prof.Dr. D. Ciurchea

Google AdSense

USA
Mountain View


duci
Forum Admin



210 Posts

Posted - 08/07/2005 :  10:06:18  Show Profile  Email Poster Send duci a Private Message
Exemplu WinBGI - graficul functiei sin(x)/x - limbajul C

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <winbgim.h>

/* O reprezentare grafica elementara a unei functii de
o singura variabila */

double func(double x,double pi)
{
double z;
z = 50.0 * sin ( x * x ) / 1000.0 * exp( - x / 2.0 );
return (z);
}
double MAX ( double a , double b )
{
if ( a >= b ) return a ; else return b ;
}
double MIN(double a, double b)
{
if ( a <= b ) return a ; else return b ;
}

void plot ( double v[] , double may , double miy)
{
int i,j;
for ( i = 0 ; i < 640 ; i++ )
{
j = 349 - 350 / (may-miy) * ( v[i] - miy );// Intreg !!!
putpixel ( i , j , 15 );//Functia plotata cu puncte
}
}

int main()

{
double y,a,b,h,may,miy;
double v[640];//vector continand esantionarea functiei
int i,j,k;
double pi=atan(1.0)*4.0;
a = 0.0 ;//Intervalul de plotare [a,b]
b = 6.0 ;
h= ( b - a ) / 640 ;//Pasul in reprezentarea grafica
//Calculam functia pe intervalul [a,b] cu pasul h
for ( i = 0 ; i < 640 ;
v[ i ] = func( a + i * h , pi ),i++);
//********scalare
may=v[0];
miy=v[0];
for ( i = 1 ; i < 640 ; i++ )
{
may = MAX ( may , v[i] );
miy = MIN ( miy , v[i] );
}
i = DETECT ;//Grafic BGI
j = DETECT ;
initgraph (&i,&j,"d:\\tc");
cleardevice ();
plot ( v,may,miy);//Graficul propriu-zis
closegraph ;
system ( "pause" );
return 0 ;
}

Prof.Dr. D. Ciurchea
Go to Top of Page
  Previous Topic Topic   
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
duci.ro FORUM at forumco.com © 2000-05 ForumCo.com Go To Top Of Page
Generated in 0.23 seconds. Hello from Duci !!! Snitz Forums 2000
RSS Feed 1 RSS Feed 2
Powered by ForumCo 2000-2008
TOS - AUP - URA - Privacy Policy
ForumCo Free Blogs and Galleries
Signup for a free forum or Go Banner Free