SVG/Edytory: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Lethern (dyskusja | edycje)
- stary szablon
m 3-ci sposób tworzenia grafiki
Linia 1:
Programy do tworzenia grafiki '''SVG''' można z grubsza podzielić na dwie3 grupy:
* programy specjalizowane przeznaczone przede wszystkim do obróbki grafiki SVG:
** [[w:Inkscape|Inkscape]] (zobacz [[Inkscape|podręcznik]])
Linia 10:
** [http://www.Staoffice.org/ StarOffice Draw]- od wersji 6.0
** [http://www.mayura.com/ Mayura Draw]
** Gnuplot
 
* programy ręcznie tworzące plik svg
 
Przykład tworzenia pliku svg w C :
 
<source lang=c>
/*
 
c console program based on :
cpp code by Claudio Rocchini
 
http://commons.wikimedia.org/wiki/File:Poincare_halfplane_eptagonal_hb.svg
 
 
http://validator.w3.org/
The uploaded document "circle.svg" was successfully checked as SVG 1.1.
This means that the resource in question identified itself as "SVG 1.1"
and that we successfully performed a formal validation using an SGML, HTML5 and/or XML
Parser(s) (depending on the markup language used).
 
*/
 
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
 
 
 
const double PI = 3.1415926535897932384626433832795;
 
const int iXmax = 1000,
iYmax = 1000,
radius=100,
cx=200,
cy=200;
const char *black="#FFFFFF", /* hexadecimal number as a string for svg color*/
*white="#000000";
FILE * fp;
 
void draw_circle(FILE * FileP,int radius,int cx,int cy)
{
fprintf(FileP,"<circle cx=\"%i\" cy=\"%i\" r=\"%i\" style=\"stroke:%s; stroke-width:2; fill:%s\"/>\n",
cx,cy,radius,white,black);
}
 
void beginSVG(
 
int main(){
FILE * fp;
char *filename="circle.svg";
fp = fopen(filename,"w");
char *comment = "<!-- sample comment in SVG file \n can be multi-line -->";
 
fprintf(fp,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
"%s \n "
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n"
"\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n"
"<svg width=\"20cm\" height=\"20cm\" viewBox=\"0 0 %d %d \"\n"
" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n",
comment,iXmax,iYmax);
 
 
draw_circle(fp,radius,cx,cy);
 
fprintf(fp,"</svg>\n");
fclose(fp);
printf(" file %s saved \n",filename );
getchar();
return 0;
}
 
 
</source>
 
<noinclude>