|
01-19-2017, 11:35 AM
|
#1
|
Human being with feelings
Join Date: Jan 2017
Posts: 3
|
Draw lines/arcs thicker than one pixel with LICE
I can't seem to find a way to draw lines/arcs wider than one pixel using LICE. I want to keep*my code as simple as possible, so don't want to use Cairo.
How would I achieve this?*The only hacky way I found to do it was:
Code:
pGraphics->DrawArc(&COLOR_WHITE, cX, cY, 20, mMinAngle, angle, (const IChannelBlend *)0, true);
pGraphics->DrawArc(&COLOR_WHITE, cX, cY, 20.5, mMinAngle, angle, (const IChannelBlend *)0, true);
pGraphics->DrawArc(&COLOR_WHITE, cX, cY, 21, mMinAngle, angle, (const IChannelBlend *)0, true);
pGraphics->DrawArc(&COLOR_WHITE, cX, cY, 21.5, mMinAngle, angle, (const IChannelBlend *)0, true);
pGraphics->DrawArc(&COLOR_WHITE, cX, cY, 22, mMinAngle, angle, (const IChannelBlend *)0, true);
But surely there's a cleaner way to get this done, no?
|
|
|
01-19-2017, 03:56 PM
|
#2
|
Human being with feelings
Join Date: May 2012
Location: PA, USA
Posts: 356
|
Based off of this http://www.askjf.com/index.php?q=1959s, I use something like this for a thick line:
Code:
bool IGraphics::DrawLineThick(const IColor * pColor, float xstart, float ystart, float xend, float yend, const int Thick, const IChannelBlend * pBlend, bool antiAlias)
{
_LICE::LICE_Line(mDrawBitmap, xstart, ystart, xend, yend, LiceColor(pColor), LiceWeight(pBlend), LiceBlendMode(pBlend), antiAlias);
for (int i = 0; i < Thick; i++) {
if (std::abs(xend - xstart) > std::abs(yend - ystart)) {
++ystart;
++yend;
}
else {
++xstart;
++xend;
}
_LICE::LICE_Line(mDrawBitmap, xstart, ystart, xend, yend, LiceColor(pColor), LiceWeight(pBlend), LiceBlendMode(pBlend), antiAlias);
}
return false;
}
I don't use arcs, but I am sure you could do something similar
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 08:01 AM.
|