Tutorial
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
69
s = 30 * sinf(f*DegreeToPI);
UTIL_SUCCESS(ret, utLinef(putCtx, cx - c, cy - s, cx + c, cy + s));
}
px += 80;
utLineWidth(putCtx, 1.5f);
UTIL_SUCCESS(ret, utTextOut(putCtx, (MM_S32)px, (MM_S32)py, "Width 1.5"));
cx = 30 + px;
cy = 50 + py;
for
(f = 0; f < 180; f+= 9.0f)
{
c = 30 * cosf(f*DegreeToPI);
s = 30 * sinf(f*DegreeToPI);
UTIL_SUCCESS(ret, utLinef(putCtx, cx - c, cy - s, cx + c, cy + s));
}
px += 80;
utLineWidth(putCtx, 2.0f);
UTIL_SUCCESS(ret, utTextOut(putCtx, (MM_S32)px, (MM_S32)py, "Width 2.0"));
cx = 30 + px;
cy = 50 + py;
for
(f = 0; f < 180; f+= 9.0f)
{
c = 30 * cosf(f*DegreeToPI);
s = 30 * sinf(f*DegreeToPI);
UTIL_SUCCESS(ret, utLinef(putCtx, cx - c, cy - s, cx + c, cy + s));
}
return
ret;
6.12.3.2 Drawpoints
Draws 12 points with different sizes using the utility function.
/* Now paint */
for
(i = 1; i < 12; i++)
{
utPointSize(putCtx, (MM_FLOAT)i);
UTIL_SUCCESS(ret, utPoint(putCtx, 5 + i * i, 105));
}
6.12.3.3 DrawSample
This function draws a flower with different line widths and colors.