wxWindows SVG DC Test results

The test sample from wxWindows 2.40 release was built and screendumps taken of the first 3 tests. The SVG copy was saved by creating a wxSVGFileDC and drawing using the same code:
    wxSVGFileDC svgDC (filename, 600, 650) ;
m_canvas->OnDraw (svgDC);
return svgDC.Ok();
The svg files here are between 1.5 and 2kbytes, the png images from 8 to 13 k

Line test

// draw lines to make a cross
dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200);
// draw point colored line and spline
wP = *wxCYAN_PEN ;
wP.SetWidth(3);
dc.SetPen(wP);

dc.DrawPoint (25,15) ;
dc.DrawLine(50, 30, 200, 30);
dc.DrawSpline(50, 200, 50, 100, 200, 10);

PNG Image
Screen dump of Line test
Line test as SVG

Filled
object test

// draw standard shapes
dc.SetBrush(*wxCYAN_BRUSH);
dc.SetPen(*wxRED_PEN);
dc.DrawRectangle(10, 10, 100, 70);
wB = wxBrush ("DARK ORCHID", wxTRANSPARENT);
dc.SetBrush (wB);
dc.DrawRoundedRectangle(50, 50, 100, 70, 20);
dc.SetBrush (wxBrush("GOLDENROD", wxSOLID) );
dc.DrawEllipse(100, 100, 100, 50);

points[0].x = 100; points[0].y = 200;
points[1].x = 70; points[1].y = 260;
points[2].x = 160; points[2].y = 230;
points[3].x = 40; points[3].y = 230;
points[4].x = 130; points[4].y = 260;
points[5].x = 100; points[5].y = 200;

dc.DrawPolygon(5, points);
dc.DrawLines (6, points, 160);

PNG Image
Screen dump of Line test
Filled Object test as SVG

Text test

// draw text in Arial or similar font
dc.DrawLine(50,25,50,35);
dc.DrawLine(45,30,55,30);
dc.DrawText(wxT("This is a Swiss-style string"),
 50, 30);
wC = dc.GetTextForeground() ;

dc.SetTextForeground ("FIREBRICK");
dc.DrawText(wxT("This is a Red string"),
 50, 200);
dc.DrawRotatedText(wxT("This is a 45 deg string"),
 50, 200, 45);
dc.DrawRotatedText(wxT("This is a 90 deg string"),
 50, 200, 90);
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD,
FALSE, wxT("Times New Roman"));
dc.SetFont(wF);
dc.SetTextForeground (wC) ;
dc.DrawText
(wxT("This is a Times-style string"),
 50, 60);
PNG Image
Screen dump of Line test
Text test as SVG

Pie test

dc.SetBrush(*wxGREEN_BRUSH);
dc.DrawArc ( 200,300, 370,230,
300.0,300.0 );
dc.SetBrush(*wxBLUE_BRUSH);
dc.DrawArc ( 270-50, 270-86,
270-86, 270-50, 270.0,270.0 );
dc.SetDeviceOrigin(-10,-10);
dc.DrawArc ( 270-50, 270-86,
270-86, 270-50, 270.0,270.0 );
dc.SetDeviceOrigin(0,0);

wP.SetColour ("CADET BLUE");
dc.SetPen(wP);
dc.DrawArc ( 75,125, 110, 40, 75.0, 75.0 );

wP.SetColour ("SALMON");
dc.SetPen(wP);
dc.SetBrush(*wxRED_BRUSH);
//top left corner, width and height,
//start and end angle

// 315 same center and x-radius as
//last pie-arc, half Y radius
dc.DrawEllipticArc(25,50,100,50,180.0,45.0) ;

wP = *wxCYAN_PEN ;
wP.SetWidth(3);
dc.SetPen(wP);
//wxTRANSPARENT));
dc.SetBrush (wxBrush ("SALMON",wxSOLID)) ;
dc.DrawEllipticArc(300, 0,200,100, 0.0,145.0) ;
//same end point
dc.DrawEllipticArc(300, 50,200,100,90.0,145.0) ;
dc.DrawEllipticArc(300,100,200,100,90.0,345.0) ;

PNG Image
Screen dump of Line test
Pie test as SVG
Page created by Chris Elliott, 16 Jan 03