I have probably found the solution of my problems with rendering:
The rendering loop is probably implemented by a few calls of function Render(...). So when i'm trying to draw text on position defined by pixel inside of this selection, then the letter almost aways is outside of roi rectagles.
1st problem: i cant use Clipping with roi boundaries to clip the text (i have to use different clipping recangle)
2nd problem: Selection is not aways rectangle, but sometimes elipse or any strange shape
3rd problem: Render function is called a few times for one "refresh" (not once for one refresh as i have assumed earlier). So second call of Render function overwrites result of first call, etc.
1st a 2nd problem solution: i'm using self-made checking of boundaries:
Rectangle letterRect = new Rectangle(x, y, letter.Width, letter.Height);
if (isInside(letterRect, selectionBoundarie)) { drawString(...) }
- better solution whould be design pattern map
( int[,] selectionMap = new int[picture.Width, picture.Height]; foreach (x,y) { selectionMap[x,y] = isSelected(x,y) ? 0xFFFF : 0x0;} ), but it's a lot of work and it's not task of effect plugin, it's task of API
3rd problem solution:
- i have disabled multiprocessor (multithread) support for this effect plugin
-> position of next part of selection shape for rendering function is down in comparsion with previous part of selection shape.
- drawString(x, y - Font.Height, ...)
So final result of this dicussion is almost done plugin. I have to cleanup source codes - delete messy code, add comments and make some culture in source code at all. After that i will send links for download.