| Top |
|
[VC++] m_Engine.SetFileName("Sample");
// **** Page One - Basic Shapes **** m_Engine.BeginDoc();
COleFont fnt = m_Engine.GetFont(); fnt.SetUnderline(true); CY fntSize = fnt.GetSize(); fntSize.int64 = 140000; fnt.SetSize(fntSize); m_Engine.SetFont(fnt);
// Line m_Engine.TextOutXY(0.5, 2.0, "Line"); m_Engine.LineA(0.5, 2.5, 2, 3.5);
// Arc m_Engine.TextOutXY(3, 2, "Arc"); m_Engine.Arc(3, 2.5, 5, 3.5, 5, 3, 3, 3);
// Ellipse m_Engine.TextOutXY(6, 2, "Ellipse"); m_Engine.Ellipse(6, 2.5, 8, 3.5, false);
// Chord m_Engine.TextOutXY(1, 4.5, "Chord"); m_Engine.SetBrushStyle(bsHorizontal); m_Engine.SetBrushColor(RGB(0, 255, 0)); m_Engine.Chord(0.5, 5, 3, 6, 1.5, 2, 4.5, 6, true);
// Pie m_Engine.SetBrushStyle(bsClear); m_Engine.TextOutXY(5, 4.5, "Pie"); m_Engine.SetBrushColor(RGB(255, 0, 0)); m_Engine.SetBrushStyle(bsSolid); m_Engine.Pie(4, 5, 6, 6, 6, 5.5, 5, 5, true);
// Rectangle m_Engine.SetBrushStyle(bsClear); m_Engine.TextOutXY(1, 7, "Rectangle"); m_Engine.SetBrushColor(RGB(175, 175, 255)); m_Engine.SetBrushStyle(bsBDiagonal); m_Engine.Rectangle(1, 7.5, 3, 9, true);
// RoundRect m_Engine.SetBrushStyle(bsClear); m_Engine.TextOutXY(5.2, 7, "RoundRect"); m_Engine.SetBrushColor(RGB(255, 175, 175)); m_Engine.SetBrushStyle(bsFDiagonal); m_Engine.RoundRect(5, 7.5, 7, 9, 1, 1, true);
// **** Page Two - Poly Shapes **** m_Engine.NewPage();
VARIANT varX, varY; SAFEARRAYBOUND bound; void *ptr;
// Polyline. double xPoints[4] = {1, 1, 2, 3}; double yPoints[4] = {2.5, 4, 4, 3};
bound.cElements = 4; bound.lLbound = 0;
// Put the x-cordinates points in a variant array varX.vt = VT_R8; varX.parray = SafeArrayCreate(VT_R8, 1, &bound); SafeArrayAccessData(varX.parray, &ptr); memcpy(ptr, xPoints, sizeof(xPoints)); SafeArrayUnaccessData(varX.parray);
// Put the y-cordinates points in a variant array varY.vt = VT_R8; varY.parray = SafeArrayCreate(VT_R8, 1, &bound); SafeArrayAccessData(varY.parray, &ptr); memcpy(ptr, yPoints, sizeof(yPoints)); SafeArrayUnaccessData(varY.parray);
m_Engine.SetBrushStyle(bsClear); m_Engine.TextOutXY(1, 2, "PolyLine"); m_Engine.SetPenStyle(psDash); m_Engine.SetPenColor(RGB(255, 0, 0)); m_Engine.PolyLine(varX, varY);
//Polygon double xPoints1[5] = {4, 6, 6.5, 7, 6.5}; double yPoints1[5] = {2.5, 2.5, 3.3, 3, 3.7};
bound.cElements = 5; bound.lLbound = 0;
// Put the x-cordinates points in a variant array varX.vt = VT_R8; varX.parray = SafeArrayCreate(VT_R8, 1, &bound); SafeArrayAccessData(varX.parray, &ptr); memcpy(ptr, xPoints1, sizeof(xPoints1)); SafeArrayUnaccessData(varX.parray);
// Put the y-cordinates points in a variant array varY.vt = VT_R8; varY.parray = SafeArrayCreate(VT_R8, 1, &bound); SafeArrayAccessData(varY.parray, &ptr); memcpy(ptr, yPoints1, sizeof(yPoints1)); SafeArrayUnaccessData(varY.parray);
m_Engine.SetBrushStyle(bsClear); m_Engine.TextOutXY(4, 2, "Polygon"); m_Engine.SetPenStyle(psSolid); m_Engine.SetPenColor(RGB(0, 0, 255)); m_Engine.SetBrushColor(RGB(175, 175, 175)); m_Engine.SetBrushStyle(bsDiagCross); m_Engine.Polygon(varX, varY, true);
//PolyBezier double xPoints2[7] = {1, 0, 4, 3, 8, 0, 5}; double yPoints2[7] = {5.5, 6, 6.5, 7.5, 6, 8, 5.2};
bound.cElements = 7; bound.lLbound = 0;
// Put the x-cordinates points in a variant array varX.vt = VT_R8; varX.parray = SafeArrayCreate(VT_R8, 1, &bound); SafeArrayAccessData(varX.parray, &ptr); memcpy(ptr, xPoints2, sizeof(xPoints2)); SafeArrayUnaccessData(varX.parray);
// Put the y-cordinates points in a variant array varY.vt = VT_R8; varY.parray = SafeArrayCreate(VT_R8, 1, &bound); SafeArrayAccessData(varY.parray, &ptr); memcpy(ptr, yPoints2, sizeof(yPoints2)); SafeArrayUnaccessData(varY.parray);
m_Engine.SetBrushStyle(bsClear); m_Engine.TextOutXY(1, 5, "PolyBezier"); m_Engine.PolyBezier(varX, varY);
m_Engine.EndDoc();
[VB] With gtEngineX1 .FileName = "Sample"
' **** Page One - Basic Shapes **** .BeginDoc
.Font.Underline = True .Font.Size = 14
' Line .TextOutXY 0.5, 2, "Line" .LineA 0.5, 2.5, 2, 3.5
' Arc .TextOutXY 3, 2, "Arc" .Arc 3, 2.5, 5, 3.5, 5, 3, 3, 3
' Ellipse .TextOutXY 6, 2, "Ellipse" .Ellipse 6, 2.5, 8, 3.5, False
' Chord .TextOutXY 1, 4.5, "Chord" .BrushStyle = bsHorizontal .BrushColor = RGB(0, 255, 0) .Chord 0.5, 5, 3, 6, 1.5, 2, 4.5, 6, True
' Pie .BrushStyle = bsClear .TextOutXY 5, 4.5, "Pie" .BrushColor = RGB(255, 0, 0) .BrushStyle = bsSolid .Pie 4, 5, 6, 6, 6, 5.5, 5, 5, True
' Rectangle .BrushStyle = bsClear .TextOutXY 1, 7, "Rectangle" .BrushColor = RGB(175, 175, 255) .BrushStyle = bsBDiagonal .Rectangle 1, 7.5, 3, 9, True
' RoundRect .BrushStyle = bsClear .TextOutXY 5.2, 7, "RoundRect" .BrushColor = RGB(255, 175, 175) .BrushStyle = bsFDiagonal .RoundRect 5, 7.5, 7, 9, 1, 1, True
' **** Page Two - Poly Shapes **** .NewPage
' Polyline Dim xPoints(0 To 3) As Double Dim yPoints(0 To 3) As Double
xPoints(0) = 1 xPoints(1) = 1 xPoints(2) = 2 xPoints(3) = 3
yPoints(0) = 2.5 yPoints(1) = 4 yPoints(2) = 4 yPoints(3) = 3
.BrushStyle = bsClear .TextOutXY 1, 2, "PolyLine" .PenStyle = psDash .PenColor = RGB(255, 0, 0) .PolyLine xPoints, yPoints
' Polygon Dim xPoints1(4) As Double Dim yPoints1(4) As Double
xPoints1(0) = 4 xPoints1(1) = 6 xPoints1(2) = 6.5 xPoints1(3) = 7 xPoints1(4) = 6.5
yPoints1(0) = 2.5 yPoints1(1) = 2.5 yPoints1(2) = 3.3 yPoints1(3) = 3 yPoints1(4) = 3.7
.BrushStyle = bsClear .TextOutXY 4, 2, "Polygon" .PenStyle = psSolid .PenColor = RGB(0, 0, 255) .BrushColor = RGB(175, 175, 175) .BrushStyle = bsDiagCross .Polygon xPoints1, yPoints1, True
' PolyBezier Dim xPoints2(6) As Double Dim yPoints2(6) As Double xPoints2(0) = 1 xPoints2(1) = 0 xPoints2(2) = 4 xPoints2(3) = 3 xPoints2(4) = 8 xPoints2(5) = 0 xPoints2(6) = 5
yPoints2(0) = 5.5 yPoints2(1) = 6 yPoints2(2) = 6.5 yPoints2(3) = 7.5 yPoints2(4) = 6 yPoints2(5) = 8 yPoints2(6) = 5.2
.BrushStyle = bsClear .TextOutXY 1, 5, "PolyBezier" .PolyBezier xPoints2, yPoints2
.EndDoc End With
[C#]
axgtEngineX1.FileName = "Sample" ; // **** Page One - Basic Shapes **** axgtEngineX1.BeginDoc(); Font F = new Font( "Arial", 14 , FontStyle.Underline); axgtEngineX1.Font = F; // Line axgtEngineX1.TextOutXY( 0.5, 2, "Line" ); axgtEngineX1.LineA( 0.5, 2.5, 2, 3.5 ); // Arc axgtEngineX1.TextOutXY( 3, 2, "Arc" ); axgtEngineX1.Arc( 3, 2.5, 5, 3.5, 5, 3, 3, 3 ); // Ellipse axgtEngineX1.TextOutXY( 6, 2, "Ellipse" ); axgtEngineX1.Ellipse( 6, 2.5, 8, 3.5, false ); // Chord axgtEngineX1.TextOutXY( 1, 4.5, "Chord" ); axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsHorizontal; axgtEngineX1.BrushColor = System.Drawing.Color.Red; axgtEngineX1.Chord( 0.5, 5, 3, 6, 1.5, 2, 4.5, 6, true ); // Pie axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsClear; axgtEngineX1.TextOutXY( 5, 4.5, "Pie" ); axgtEngineX1.BrushColor = System.Drawing.Color.Red; axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsSolid; axgtEngineX1.Pie( 4, 5, 6, 6, 6, 5.5, 5, 5, true); // Rectangle axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsClear; axgtEngineX1.TextOutXY( 1, 7, "Rectangle" ); axgtEngineX1.BrushColor = System.Drawing.Color.Red; axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsBDiagonal; axgtEngineX1.Rectangle( 1, 7.5, 3, 9, true ); // RoundRect axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsClear; axgtEngineX1.TextOutXY( 5.2, 7, "RoundRect" ); axgtEngineX1.BrushColor = System.Drawing.Color.Red; axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsFDiagonal; axgtEngineX1.RoundRect( 5, 7.5, 7, 9, 1, 1, true ); // **** Page Two - Poly Shapes **** axgtEngineX1.NewPage(); // Polyline double[] xPoints, yPoints; xPoints= new double[4]; yPoints= new double[4]; xPoints[0] = 1 ; xPoints[1] = 1 ; xPoints[2] = 2 ; xPoints[3] = 3 ; yPoints[0] = 2.5; yPoints[1] = 4 ; yPoints[2] = 4 ; yPoints[3] = 3 ; axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsClear; axgtEngineX1.TextOutXY( 1, 2, "PolyLine" ); axgtEngineX1.PenStyle = eDocEngineX.TxgtPenStyle.psDash; axgtEngineX1.PenColor = System.Drawing.Color.Red; axgtEngineX1.PolyLine( xPoints, yPoints ); // Polygon double[] xPoints1, yPoints1; yPoints1= new double[5]; xPoints1[0] = 4 ; xPoints1[2] = 6.5; xPoints1[3] = 7 ; xPoints1[4] = 6.5; yPoints1[0] = 2.5; yPoints1[1] = 2.5; yPoints1[2] = 3.3; yPoints1[3] = 3; yPoints1[4] = 3.7; axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsClear; axgtEngineX1.PenStyle = eDocEngineX.TxgtPenStyle.psSolid ; axgtEngineX1.PenColor = System.Drawing.Color.Red; axgtEngineX1.BrushColor = System.Drawing.Color.Green; axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsDiagCross; axgtEngineX1.Polygon( xPoints1, yPoints1, true ) ; // PolyBezier double[] xPoints2, yPoints2; xPoints2= new double[7]; yPoints2= new double[7]; xPoints2[0] = 1 ; xPoints2[1] = 0 ; xPoints2[2] = 4 ; xPoints2[3] = 3 ; xPoints2[4] = 8 ; xPoints2[5] = 0 ; xPoints2[6] = 5 ; yPoints2[0] = 5.5; yPoints2[1] = 6 ; yPoints2[2] = 6.5; yPoints2[3] = 7.5 ; yPoints2[4] = 6 ; yPoints2[5] = 8 ; yPoints2[6] = 5.2; axgtEngineX1.BrushStyle = eDocEngineX.TxgtBrushStyle.bsClear; axgtEngineX1.TextOutXY( 1, 5, "PolyBezier" ); axgtEngineX1.PolyBezier( xPoints2, yPoints2); axgtEngineX1.EndDoc();
|