本文整理汇总了C++中CG32bitImage::DrawLine方法的典型用法代码示例。如果您正苦于以下问题:C++ CG32bitImage::DrawLine方法的具体用法?C++ CG32bitImage::DrawLine怎么用?C++ CG32bitImage::DrawLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CG32bitImage
的用法示例。
在下文中一共展示了CG32bitImage::DrawLine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawLaserBeam
void DrawLaserBeam (CG32bitImage &Dest, const SBeamDrawCtx &Ctx)
// DrawLaserBeam
//
// Draws a simple laser beam
{
CG32bitPixel rgbGlow = CG32bitPixel(Ctx.rgbSecondaryColor, 100);
Dest.DrawLine(Ctx.xFrom, Ctx.yFrom,
Ctx.xTo, Ctx.yTo,
3,
rgbGlow);
Dest.DrawLine(Ctx.xFrom, Ctx.yFrom,
Ctx.xTo, Ctx.yTo,
1,
Ctx.rgbPrimaryColor);
}
示例2: GenerateImageChart
//.........这里部分代码省略.........
// Paint image
if (!bTextBoxesOnly && Entry.pImage)
{
Entry.pImage->PaintImageUL(Output,
x + (Arranger.GetWidth(i) - cxImage) / 2,
y + (Arranger.GetHeight(i) - cyImage) / 2,
0,
Entry.iRotation);
}
// Paint type specific stuff
switch (Entry.pType->GetType())
{
case designStationType:
{
CStationType *pStationType = CStationType::AsType(Entry.pType);
int xStationCenter = xCenter - xOffset;
int yStationCenter = yCenter - yOffset;
if (bDockingPorts)
pStationType->PaintDockPortPositions(Output, xStationCenter, yStationCenter);
if (bDevicePos)
pStationType->PaintDevicePositions(Output, xStationCenter, yStationCenter);
// If we have docking or device positions, mark the center of the station
if (bDockingPorts || bDevicePos)
{
const int LINE_HALF_LENGTH = 24;
const CG32bitPixel RGB_CENTER_CROSS(255, 255, 0);
Output.DrawLine(xStationCenter - LINE_HALF_LENGTH, yStationCenter, xStationCenter + LINE_HALF_LENGTH, yStationCenter, 1, RGB_CENTER_CROSS);
Output.DrawLine(xStationCenter, yStationCenter - LINE_HALF_LENGTH, xStationCenter, yStationCenter + LINE_HALF_LENGTH, 1, RGB_CENTER_CROSS);
}
break;
}
}
// Paint the 3D grid, if necessary
if (b3DGrid)
{
int iScale = Entry.pImage->GetImageViewportSize();
Metric rMaxRadius = g_KlicksPerPixel * cxImage * 0.5;
const Metric rGridSize = LIGHT_SECOND;
Metric rRadius;
for (rRadius = rGridSize; rRadius <= rMaxRadius; rRadius += rGridSize)
{
int iRadius = (int)((rRadius / g_KlicksPerPixel) + 0.5);
const int iGridAngle = 8;
int iPrevAngle = 0;
int iAngle;
for (iAngle = iGridAngle; iAngle <= 360; iAngle += iGridAngle)
{
int xFrom, yFrom;
C3DConversion::CalcCoord(iScale, iPrevAngle, iRadius, 0, &xFrom, &yFrom);
int xTo, yTo;
C3DConversion::CalcCoord(iScale, iAngle, iRadius, 0, &xTo, &yTo);
Output.DrawLine(xFrom + xCenter, yFrom + yCenter, xTo + xCenter, yTo + yCenter, 1, CG32bitPixel(255, 255, 0));
iPrevAngle = iAngle;