|
From: Michael C. <win...@gm...> - 2019-09-27 15:45:05
|
I'm up to putting Quido to my sequencer.
There are questions:
1. I'm trying to create a Direct2D device so Guido can use my normal render
target, hardware accelerated.
This is the output:
[image: image.png]
When using the implemented HDC, this is the correct one:
[image: image.png]
[image: image.png]
It seems to me that some weird scaling occurs.
This is my code:
virtual void DrawMusicSymbol(float x, float y, unsigned int inSymbolID)
{
EnsureBrush();
D2D1_RECT_F ly = { 0 };
wstring yy = inSymbolID;
auto ty = MeasureString(mSys->WriteFactory, mCurrMusicFont.Text,
yy.c_str(), yy.length());
// To measure width and height, irrelevant
// The following is weird, probably
ly.left = (NextOrigin.x + x)* Scale.x;
ly.top = (NextOrigin.y + y)*Scale.y;
ly.right = ly.left + std::get<0>(ty);
ly.bottom = ly.top + std::get<1>(ty);
mSys->rt->DrawTextW(yy.c_str(), yy.length(), mCurrMusicFont.Text, ly,
NextColor);
}
I need to understand more on scaling perhaps. Any ideas?
2. Can the guido factory create all sort of elements? I want to create a
score editor and I can use it if it can create everything, otherwise I will
simply edit gmn sources with my code.
3. Is there a hit testing mechanism, information about where each element
is drawn? Notes particularly. So they can be hit-tested with the mouse and
edited perhaps. If not, I can make a keyboard-only editor.
Best Regards,
|