Accueil > > > DESSINATEUR DE FRACTALES
DESSINATEUR DE FRACTALES
Information sur la source
Description
Dessine la courbe de Mandelbrot. Code optimise, a compiler avec mingw32 ( ou DevCpp ). Les calculs sont faits en assembleurs. Cependant, la partie affichage ggnerait à être améliorée pour ne pas réafficher le fractale à chaque dessinage de la fenetre.
Source
- #include <windows.h>
- #include <stdio.h>
- #include <math.h>
-
- #define ID_BUTTON_DESSINER 100
- #define ID_EDIT_CRMIN 101
- #define ID_EDIT_CRMAX 102
- #define ID_EDIT_CIMIN 103
- #define ID_EDIT_CIMAX 104
- #define ID_EDIT_N 105
- #define ID_STATIC_CR 106
- #define ID_STATIC_CI 107
-
- /* Declare Windows procedure */
- LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);
- /* Make the class name into a global variable */
- char szClassName[ ] = "WindowsApp";
- COLORREF fractal[600][800];
- double crmax,crmin, cimax,cimin, crpas,cipas;
- HWND hwndmain, hbouton, hedit_crmin, hedit_crmax, hedit_cimin, hedit_cimax, hedit_n, hstatic_cr, hstatic_ci;
- MSG messages; /* Here messages to the application are saved */
- int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil){
- WNDCLASSEX wincl; /* Data structure for the windowclass */
-
- /* The Window structure */
- wincl.hInstance = hThisInstance;
- wincl.lpszClassName = szClassName;
- wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
- wincl.style = CS_DBLCLKS; /* Catch double-clicks */
- wincl.cbSize = sizeof(WNDCLASSEX);
-
- /* Use default icon and mouse-pointer */
- wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
- wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
- wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
- wincl.lpszMenuName = NULL; /* No menu */
- wincl.cbClsExtra = 0; /* No extra bytes after the window class */
- wincl.cbWndExtra = 0; /* structure or the window instance */
- /* Use light-gray as the background of the window */
- wincl.hbrBackground =(HBRUSH) GetStockObject(LTGRAY_BRUSH);
-
-
-
- /* Register the window class, if fail quit the program */
- if(!RegisterClassEx(&wincl)) return 0;
-
- /* The class is registered, let's create the program*/
- hwndmain = CreateWindowEx(
- 0, /* Extended possibilites for variation */
- szClassName, /* Classname */
- "Mandelbrot", /* Title Text */
- WS_OVERLAPPEDWINDOW, /* default window */
- CW_USEDEFAULT, /* Windows decides the position */
- CW_USEDEFAULT, /* where the window ends up on the screen */
- 1015, /* The programs width */
- 627, /* and height in pixels */
- HWND_DESKTOP, /* The window is a child-window to desktop */
- NULL, /* No menu */
- hThisInstance, /* Program Instance handler */
- NULL /* No Window Creation data */
- );
-
- int i,j;
- for(i=0;i<600;i++)
- for(j=0;j<800;j++)
- fractal[i][j]=RGB(0,0,0);
- /* Make the window visible on the screen */
-
-
-
- hbouton=CreateWindowEx (0,"BUTTON","dessiner",WS_CHILD|WS_VISIBLE|BS_DEFPUSHBUTTON,805,260,100,25,
- hwndmain,(HMENU)ID_BUTTON_DESSINER,hThisInstance,NULL);
-
- hedit_crmin=CreateWindowEx (0,"EDIT","-2.1",WS_CHILD|WS_VISIBLE|WS_BORDER ,805,30,200,20,
- hwndmain,(HMENU)ID_EDIT_CRMIN,hThisInstance,NULL);
- hedit_crmax=CreateWindowEx (0,"EDIT","0.9",WS_CHILD|WS_VISIBLE|WS_BORDER,805,80,200,20,
- hwndmain,(HMENU)ID_EDIT_CRMAX,hThisInstance,NULL);
- hedit_cimin=CreateWindowEx (0,"EDIT","-1.2",WS_CHILD|WS_VISIBLE|WS_BORDER,805,130,200,20,
- hwndmain,(HMENU)ID_EDIT_CIMIN,hThisInstance,NULL);
- hedit_cimax=CreateWindowEx (0,"EDIT","1.2",WS_CHILD|WS_VISIBLE|WS_BORDER,805,180,200,20,
- hwndmain,(HMENU)ID_EDIT_CIMAX,hThisInstance,NULL);
- hedit_n=CreateWindowEx (0,"EDIT","255",WS_CHILD|WS_VISIBLE|WS_BORDER,805,230,75,20,
- hwndmain,(HMENU)ID_EDIT_N,hThisInstance,NULL);
-
- CreateWindowEx (0,"STATIC","Cr min =",WS_CHILD|WS_VISIBLE,805,5,60,20,
- hwndmain,(HMENU)0,hThisInstance,NULL);
- CreateWindowEx (0,"STATIC","Cr max =",WS_CHILD|WS_VISIBLE,805,55,60,20,
- hwndmain,(HMENU)0,hThisInstance,NULL);
- CreateWindowEx (0,"STATIC","Ci min =",WS_CHILD|WS_VISIBLE,805,105,60,20,
- hwndmain,(HMENU)0,hThisInstance,NULL);
- CreateWindowEx (0,"STATIC","Ci max =",WS_CHILD|WS_VISIBLE,805,155,60,20,
- hwndmain,(HMENU)0,hThisInstance,NULL);
- CreateWindowEx (0,"STATIC","N =",WS_CHILD|WS_VISIBLE,805,205,30,20,
- hwndmain,(HMENU)0,hThisInstance,NULL);
-
- CreateWindowEx (0,"STATIC","cr =",WS_CHILD|WS_VISIBLE,805,500,30,20,
- hwndmain,(HMENU)0,hThisInstance,NULL);
- CreateWindowEx (0,"STATIC","ci =",WS_CHILD|WS_VISIBLE,805,550,30,20,
- hwndmain,(HMENU)0,hThisInstance,NULL);
-
- hstatic_cr= CreateWindowEx (0,"STATIC","",WS_CHILD|WS_VISIBLE,805,525,200,20,
- hwndmain,(HMENU)ID_STATIC_CR,hThisInstance,NULL);
- hstatic_ci= CreateWindowEx (0,"STATIC","",WS_CHILD|WS_VISIBLE,805,575,200,20,
- hwndmain,(HMENU)ID_STATIC_CI,hThisInstance,NULL);
-
- ShowWindow(hwndmain, nFunsterStil);
-
-
-
- /* Run the message loop. It will run until GetMessage( ) returns 0 */
- while(GetMessage(&messages, NULL, 0, 0))
- {
- /* Translate virtual-key messages into character messages */
- TranslateMessage(&messages);
- /* Send message to WindowProcedure */
- DispatchMessage(&messages);
- }
-
- /* The program return-value is 0 - The value that PostQuitMessage( ) gave */
- return messages.wParam;
- }
-
- COLORREF Palette(int e){
- int k=((int)sqrt(e)*48)%768;
- COLORREF r;
- if(k<256) r=RGB(k,0,255-k);
- if(k<512 && k>=256) r=RGB(511-k,k-256,0);
- if(k>=512) r=RGB(0,767-k,k-512);
- if(r==0){
- char tampontxt[100];
- sprintf(tampontxt,"k=%d m=%d",k,e);
- MessageBox(hwndmain,tampontxt,"",MB_OK);
- }
- return r;
- }
-
- /* This function is called by the Windows function DispatchMessage( ) */
- LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- HDC hdc;
- PAINTSTRUCT ps;
- int x,y,i,j;
- switch (message) /* handle the messages */
- {
- case WM_DESTROY:
- PostQuitMessage(0); /* send a WM_QUIT to the message queue */
- break;
- case WM_COMMAND:
-
- if ((LOWORD(wParam) == ID_BUTTON_DESSINER) && (HIWORD(wParam) == BN_CLICKED)){
- long double cr,ci;
- char tampontxt[10000];
- int Nmax;
-
-
- GetDlgItemText(hwndmain,ID_EDIT_CRMIN,tampontxt,100);
- sscanf(tampontxt,"%lf",&crmin);
-
- GetDlgItemText(hwndmain,ID_EDIT_CRMAX,tampontxt,100);
- sscanf(tampontxt,"%lf",&crmax);
-
-
- GetDlgItemText(hwndmain,ID_EDIT_CIMIN,tampontxt,100);
- sscanf(tampontxt,"%lf",&cimin);
-
- GetDlgItemText(hwndmain,ID_EDIT_CIMAX,tampontxt,100);
- sscanf(tampontxt,"%lf",&cimax);
-
- Nmax=GetDlgItemInt(hwndmain,ID_EDIT_N,NULL,FALSE);
-
- crpas=(crmax-crmin)/800;
- cipas=(cimax-cimin)/600;
-
- hdc=GetDC (hwnd);
- for (x=0;x<800;x++){
- cr=x*crpas+crmin;
-
- for (y=0;y<600;y++){
- ci=y*cipas+cimin;
- char diverge=1;
- asm volatile("fld1\n"
- "fadd %%st(0)\n"
- "fadd %%st(0)\n"//pour charger 4
- "fldt %1\n"
- "fldt %0\n"
- "fldz\n"
- "fldz"
- :
- : "m"(cr), "m"(ci)
- );
- int k;
- for (k=0;k<Nmax && diverge;k++){
- asm volatile( "movb $0,%0\n"
- //calcul de zi
- "fld %%st(0)\n"
- "fmul %%st(2)\n"
- "fadd %%st(0)\n" //multiplie par 2
- "fadd %%st(4)\n"
- //calcul de zr
- "fld %%st(1)\n"
- "fmul %%st(0)\n" //élève au carré
- "fld %%st(3)\n"
- "fmul %%st(0)\n"
- "fsubrp\n"
- "fadd %%st(4)\n"
- //on remet les données a leur place
- "fstp %%st(2)\n"
- "fstp %%st(2)\n"
- //comparaison de la valeur absolue pour voir si on sort
- "fld %%st(0)\n"
- "fmul %%st(0)\n" //élève au carré
- "fld %%st(2)\n"
- "fmul %%st(0)\n"
- "faddp\n"
- "fcomip %%st(5),%%st(0)\n"
- "sbbb $0,%0"
- :"=g" (diverge)
- );
-
- }
- // on libère le FPU
- asm volatile( "fstp %%st(0)\n"
- "fstp %%st(0)\n"
- "fstp %%st(0)\n"
- "fstp %%st(0)\n"
- "fstp %%st(0)\n":::"st");
-
- if (diverge){
- fractal[y][x]=RGB(0,0,0);
- SetPixel(hdc,x,y,RGB(0,0,0));
- } else {
- fractal[y][x]=Palette(k);
- SetPixel(hdc,x,y,Palette(k));
- }
- }
-
- }
- ReleaseDC(hwnd,hdc);
- } else return DefWindowProc(hwnd, message, wParam, lParam);
- break;
- case WM_PAINT:
- hdc=BeginPaint(hwndmain,&ps);
- for (i=0;i<800;i++)
- for (j=0;j<600;j++)
- SetPixel(hdc,i,j,fractal[j][i]);
- EndPaint(hwndmain,&ps);
-
- break;
- case WM_MOUSEMOVE:
- x=LOWORD(lParam);
- y=HIWORD(lParam);
- if (x>0 && x<800 && y>0 && y<600){
- char tampon[1000];
- sprintf(tampon,"%.20lf",(double)(x*crpas+crmin) );
- SetWindowText(hstatic_cr,tampon);
- sprintf(tampon,"%.20lf",(double)(y*cipas+cimin) );
- SetWindowText(hstatic_ci,tampon);
- }
- break;
- case WM_LBUTTONDOWN:
- x=LOWORD(lParam);
- y=HIWORD(lParam);
- if (x>0 && x<800 && y>0 && y<600){
- char tampon[1000];
- sprintf(tampon,"%.20lf",(double)(x*crpas+crmin) );
- SetWindowText(hedit_crmin,tampon);
- sprintf(tampon,"%.20lf",(double)(y*cipas+cimin) );
- SetWindowText(hedit_cimin,tampon);
- }
- break;
- case WM_LBUTTONUP:
- x=LOWORD(lParam);
- y=HIWORD(lParam);
- if (x>0 && x<800 && y>0 && y<600){
- char tampon[1000];
- sprintf(tampon,"%.20lf",(double)(x*crpas+crmin) );
- SetWindowText(hedit_crmax,tampon);
- sprintf(tampon,"%.20lf",(double)(y*cipas+cimin) );
- SetWindowText(hedit_cimax,tampon);
- }
- break;
- default: /* for messages that we don't deal with */
- return DefWindowProc(hwnd, message, wParam, lParam);
-
-
- }
- return 0;
- }
#include <windows.h>
#include <stdio.h>
#include <math.h>
#define ID_BUTTON_DESSINER 100
#define ID_EDIT_CRMIN 101
#define ID_EDIT_CRMAX 102
#define ID_EDIT_CIMIN 103
#define ID_EDIT_CIMAX 104
#define ID_EDIT_N 105
#define ID_STATIC_CR 106
#define ID_STATIC_CI 107
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "WindowsApp";
COLORREF fractal[600][800];
double crmax,crmin, cimax,cimin, crpas,cipas;
HWND hwndmain, hbouton, hedit_crmin, hedit_crmax, hedit_cimin, hedit_cimax, hedit_n, hstatic_cr, hstatic_ci;
MSG messages; /* Here messages to the application are saved */
int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil){
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof(WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use light-gray as the background of the window */
wincl.hbrBackground =(HBRUSH) GetStockObject(LTGRAY_BRUSH);
/* Register the window class, if fail quit the program */
if(!RegisterClassEx(&wincl)) return 0;
/* The class is registered, let's create the program*/
hwndmain = CreateWindowEx(
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Mandelbrot", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
1015, /* The programs width */
627, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
int i,j;
for(i=0;i<600;i++)
for(j=0;j<800;j++)
fractal[i][j]=RGB(0,0,0);
/* Make the window visible on the screen */
hbouton=CreateWindowEx (0,"BUTTON","dessiner",WS_CHILD|WS_VISIBLE|BS_DEFPUSHBUTTON,805,260,100,25,
hwndmain,(HMENU)ID_BUTTON_DESSINER,hThisInstance,NULL);
hedit_crmin=CreateWindowEx (0,"EDIT","-2.1",WS_CHILD|WS_VISIBLE|WS_BORDER ,805,30,200,20,
hwndmain,(HMENU)ID_EDIT_CRMIN,hThisInstance,NULL);
hedit_crmax=CreateWindowEx (0,"EDIT","0.9",WS_CHILD|WS_VISIBLE|WS_BORDER,805,80,200,20,
hwndmain,(HMENU)ID_EDIT_CRMAX,hThisInstance,NULL);
hedit_cimin=CreateWindowEx (0,"EDIT","-1.2",WS_CHILD|WS_VISIBLE|WS_BORDER,805,130,200,20,
hwndmain,(HMENU)ID_EDIT_CIMIN,hThisInstance,NULL);
hedit_cimax=CreateWindowEx (0,"EDIT","1.2",WS_CHILD|WS_VISIBLE|WS_BORDER,805,180,200,20,
hwndmain,(HMENU)ID_EDIT_CIMAX,hThisInstance,NULL);
hedit_n=CreateWindowEx (0,"EDIT","255",WS_CHILD|WS_VISIBLE|WS_BORDER,805,230,75,20,
hwndmain,(HMENU)ID_EDIT_N,hThisInstance,NULL);
CreateWindowEx (0,"STATIC","Cr min =",WS_CHILD|WS_VISIBLE,805,5,60,20,
hwndmain,(HMENU)0,hThisInstance,NULL);
CreateWindowEx (0,"STATIC","Cr max =",WS_CHILD|WS_VISIBLE,805,55,60,20,
hwndmain,(HMENU)0,hThisInstance,NULL);
CreateWindowEx (0,"STATIC","Ci min =",WS_CHILD|WS_VISIBLE,805,105,60,20,
hwndmain,(HMENU)0,hThisInstance,NULL);
CreateWindowEx (0,"STATIC","Ci max =",WS_CHILD|WS_VISIBLE,805,155,60,20,
hwndmain,(HMENU)0,hThisInstance,NULL);
CreateWindowEx (0,"STATIC","N =",WS_CHILD|WS_VISIBLE,805,205,30,20,
hwndmain,(HMENU)0,hThisInstance,NULL);
CreateWindowEx (0,"STATIC","cr =",WS_CHILD|WS_VISIBLE,805,500,30,20,
hwndmain,(HMENU)0,hThisInstance,NULL);
CreateWindowEx (0,"STATIC","ci =",WS_CHILD|WS_VISIBLE,805,550,30,20,
hwndmain,(HMENU)0,hThisInstance,NULL);
hstatic_cr= CreateWindowEx (0,"STATIC","",WS_CHILD|WS_VISIBLE,805,525,200,20,
hwndmain,(HMENU)ID_STATIC_CR,hThisInstance,NULL);
hstatic_ci= CreateWindowEx (0,"STATIC","",WS_CHILD|WS_VISIBLE,805,575,200,20,
hwndmain,(HMENU)ID_STATIC_CI,hThisInstance,NULL);
ShowWindow(hwndmain, nFunsterStil);
/* Run the message loop. It will run until GetMessage( ) returns 0 */
while(GetMessage(&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
/* The program return-value is 0 - The value that PostQuitMessage( ) gave */
return messages.wParam;
}
COLORREF Palette(int e){
int k=((int)sqrt(e)*48)%768;
COLORREF r;
if(k<256) r=RGB(k,0,255-k);
if(k<512 && k>=256) r=RGB(511-k,k-256,0);
if(k>=512) r=RGB(0,767-k,k-512);
if(r==0){
char tampontxt[100];
sprintf(tampontxt,"k=%d m=%d",k,e);
MessageBox(hwndmain,tampontxt,"",MB_OK);
}
return r;
}
/* This function is called by the Windows function DispatchMessage( ) */
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
int x,y,i,j;
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage(0); /* send a WM_QUIT to the message queue */
break;
case WM_COMMAND:
if ((LOWORD(wParam) == ID_BUTTON_DESSINER) && (HIWORD(wParam) == BN_CLICKED)){
long double cr,ci;
char tampontxt[10000];
int Nmax;
GetDlgItemText(hwndmain,ID_EDIT_CRMIN,tampontxt,100);
sscanf(tampontxt,"%lf",&crmin);
GetDlgItemText(hwndmain,ID_EDIT_CRMAX,tampontxt,100);
sscanf(tampontxt,"%lf",&crmax);
GetDlgItemText(hwndmain,ID_EDIT_CIMIN,tampontxt,100);
sscanf(tampontxt,"%lf",&cimin);
GetDlgItemText(hwndmain,ID_EDIT_CIMAX,tampontxt,100);
sscanf(tampontxt,"%lf",&cimax);
Nmax=GetDlgItemInt(hwndmain,ID_EDIT_N,NULL,FALSE);
crpas=(crmax-crmin)/800;
cipas=(cimax-cimin)/600;
hdc=GetDC (hwnd);
for (x=0;x<800;x++){
cr=x*crpas+crmin;
for (y=0;y<600;y++){
ci=y*cipas+cimin;
char diverge=1;
asm volatile("fld1\n"
"fadd %%st(0)\n"
"fadd %%st(0)\n"//pour charger 4
"fldt %1\n"
"fldt %0\n"
"fldz\n"
"fldz"
:
: "m"(cr), "m"(ci)
);
int k;
for (k=0;k<Nmax && diverge;k++){
asm volatile( "movb $0,%0\n"
//calcul de zi
"fld %%st(0)\n"
"fmul %%st(2)\n"
"fadd %%st(0)\n" //multiplie par 2
"fadd %%st(4)\n"
//calcul de zr
"fld %%st(1)\n"
"fmul %%st(0)\n" //élève au carré
"fld %%st(3)\n"
"fmul %%st(0)\n"
"fsubrp\n"
"fadd %%st(4)\n"
//on remet les données a leur place
"fstp %%st(2)\n"
"fstp %%st(2)\n"
//comparaison de la valeur absolue pour voir si on sort
"fld %%st(0)\n"
"fmul %%st(0)\n" //élève au carré
"fld %%st(2)\n"
"fmul %%st(0)\n"
"faddp\n"
"fcomip %%st(5),%%st(0)\n"
"sbbb $0,%0"
:"=g" (diverge)
);
}
// on libère le FPU
asm volatile( "fstp %%st(0)\n"
"fstp %%st(0)\n"
"fstp %%st(0)\n"
"fstp %%st(0)\n"
"fstp %%st(0)\n":::"st");
if (diverge){
fractal[y][x]=RGB(0,0,0);
SetPixel(hdc,x,y,RGB(0,0,0));
} else {
fractal[y][x]=Palette(k);
SetPixel(hdc,x,y,Palette(k));
}
}
}
ReleaseDC(hwnd,hdc);
} else return DefWindowProc(hwnd, message, wParam, lParam);
break;
case WM_PAINT:
hdc=BeginPaint(hwndmain,&ps);
for (i=0;i<800;i++)
for (j=0;j<600;j++)
SetPixel(hdc,i,j,fractal[j][i]);
EndPaint(hwndmain,&ps);
break;
case WM_MOUSEMOVE:
x=LOWORD(lParam);
y=HIWORD(lParam);
if (x>0 && x<800 && y>0 && y<600){
char tampon[1000];
sprintf(tampon,"%.20lf",(double)(x*crpas+crmin) );
SetWindowText(hstatic_cr,tampon);
sprintf(tampon,"%.20lf",(double)(y*cipas+cimin) );
SetWindowText(hstatic_ci,tampon);
}
break;
case WM_LBUTTONDOWN:
x=LOWORD(lParam);
y=HIWORD(lParam);
if (x>0 && x<800 && y>0 && y<600){
char tampon[1000];
sprintf(tampon,"%.20lf",(double)(x*crpas+crmin) );
SetWindowText(hedit_crmin,tampon);
sprintf(tampon,"%.20lf",(double)(y*cipas+cimin) );
SetWindowText(hedit_cimin,tampon);
}
break;
case WM_LBUTTONUP:
x=LOWORD(lParam);
y=HIWORD(lParam);
if (x>0 && x<800 && y>0 && y<600){
char tampon[1000];
sprintf(tampon,"%.20lf",(double)(x*crpas+crmin) );
SetWindowText(hedit_crmax,tampon);
sprintf(tampon,"%.20lf",(double)(y*cipas+cimin) );
SetWindowText(hedit_cimax,tampon);
}
break;
default: /* for messages that we don't deal with */
return DefWindowProc(hwnd, message, wParam, lParam);
}
return 0;
}
Conclusion
Pour zoomer, il faut appuyer le bouton de la souris en haut a gauche du rectangle que l'on veut voir et relacher le bouton de la souris en bas a droite.
N, c'est le nombre d'itérations, il faut l'augmenter si on zoome pas mal.
Historique
- 05 mai 2009 00:23:22 :
- Ajout exmplications.
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Mandelbrot, Julia [ par Novae ]
J'essaye de programmer un log. de dessin de fractales Mandelbrot ou Julia, l'algorithme ca va mais je n'arrive pas a tracer koi ke ce soit avec graphi
Debugage assembleur [ par crocejf2000 ]
Salut,Qq'un pourrai il peut etre m'aider, j'ai une méchante érreur et jmy connais pas trop en assembleur, Borland c++ 5 me renvoi ceci : Il s'arrete a
mettre de l'assembleur en ligne sous Visual C++ [ par alain34270 ]
alainBonjour,Voilà. J'ai un problème avec mon disque dur. je voudrais lire les secteurs physiques de mon disque dur, si possible à partir de visual C+
récupérer code assembleur [ par none77 ]
Bonjour,j'aimerai savoir si lorsque je programme en C il m'est possible de récupérer le code assembleur automatiquement.Je demande ca car je dois util
Macro assembleur pour microcontroleur [ par Tyozhebes ]
Bonjour à tous ! Je suis actuellement sur la programmation d'un 68HC11 et, pour des raisons de mémoire (seulement 2ko), il me faut le programmer en
[Asm][Devc++] [ par Gonath ]
Bon voilà, je programme sur devc++ depuis peu. Je voudrais y insérer des codes en assembleur vu que je connais l'assembleur. Mais le prob, c qu'il n'a
interruprion assembleur [ par seito ]
SVP est ce que quelqu'un sait comment éxecuter les interuptions assembleurs dans Visual Cmerci
Pb avec l'assembleur dev-cpp [ par 6co ]
Voici une source vue sur cppfrance et corrigée pour l'assembleur de Dev-Cpp#include <iostream>#include <stdlib.h>#include <conio.c>#
ecriture dans un fichier en assembleur [ par ptitchep ]
bonjourje voudrais écrire dans un fichier texte en assembleur. j'ai réussi à l'ouvrir à le lire mais quand je veux y écrire des données, l'interruptio
assembleur dans du code c [ par guillaume80 ]
bjour a tous,dans un code c récupéré, j'ai pris le code pr le compiler sauf qu'il y a eu des soucis, il m'en reste un, c'est le suivant :char *ecran =
|
Derniers Blogs
SESSION SILVERLIGHT 5 3D : SLIDES ET DEMOSSESSION SILVERLIGHT 5 3D : SLIDES ET DEMOS par Groc
Durant les techdays, j'ai eu le plaisir d'animer une session sur Silverlight 5 et la 3D avec Simon Ferquel. Comme promis, voici nos slides et mes démos (celles avec le viper BSG) ici et là. Pour mémoire, les démos utilisent toutes le viper BSG...
Cliquez pour lire la suite de l'article par Groc [TECHDAYS 2012] SESSION WEBMATRIX 2 : LE COUTEAU SUISSE GRATUIT POUR VOS DéVELOPPEMENTS WEB - SLIDES[TECHDAYS 2012] SESSION WEBMATRIX 2 : LE COUTEAU SUISSE GRATUIT POUR VOS DéVELOPPEMENTS WEB - SLIDES par gpommier
Suite à la session que j'ai présenté sur WebMatrix 2, vous pouvez trouver les slides ici, ainsi que les démos en packages nuget : démos1 et démos2 J'en profite pour remercier chaleureusement tous ceux qui sont venus très nombreux à cette sess...
Cliquez pour lire la suite de l'article par gpommier [SHAREPOINT] LES SESSIONS TECHDAYS 2012.[SHAREPOINT] LES SESSIONS TECHDAYS 2012. par Patrick Guimonet
Voici donc pour ceux qui n'ont pas pu venir, ou ceux qui n'ont pas pu toutes les suivre la liste des sessions SharePoint aux TechDays 2012, que je mettrais à jour dès que les liens des vidéo seront disponibles. Ou ici : http...
Cliquez pour lire la suite de l'article par Patrick Guimonet TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3 par ROMELARD Fabrice
Speaker: Bernard Ourghanlian Cette session est comme chaque jour transmise en live par BrainSonic, et j'ai donc suivi cette troisième pleinière par ce moyen sur mon iPad . Elle est dédiée comme chaque année à la mise en perspective de l'é...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE !MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE ! par Vko
Hier durant une session dédiée aux Techdays 2012, j'ai eu le plaisir d'annoncer la sortie de la Béta 2 de Mishra Reader. C'est quoi ? Pour les utilisateurs, c'est une vraie expérience de lecture de flux RSS sur Windows. Rien à voir avec les produit...
Cliquez pour lire la suite de l'article par Vko
Logiciels
Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning
|