COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 01-19-2017, 11:35 AM   #1
karmaecrivain94
Human being with feelings
 
Join Date: Jan 2017
Posts: 3
Default 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?
karmaecrivain94 is offline   Reply With Quote
Old 01-19-2017, 03:56 PM   #2
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

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
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.