Page 1 of 1

Bug: CursorTool->Pen->Mode without effect

Posted: Thu Mar 23, 2006 7:48 am
by 9345036
Hi,

I am using the cursor tool and set the pen mode to pmCopy. However, the cursor line's color is mixed with background. Then I set pen mode to pmMerge. It shows the same behaviour.

How can I use cursor line in pmCopy mode?

Posted: Thu Mar 23, 2006 9:15 am
by narcis
Hi to2,

Please bear in mind TPenMode definition:
TPenMode indicates how the color of a pen interacts with the color of a canvas.

Unit

Graphics or QGraphics

Delphi syntax:

type TPenMode = (pmBlack, pmWhite, pmNop, pmNot, pmCopy, pmNotCopy, pmMergePenNot, pmMaskPenNot, pmMergeNotPen, pmMaskNotPen, pmMerge, pmNotMerge, pmMask, pmNotMask, pmXor, pmNotXor);

C++ syntax:

enum TPenMode { pmBlack, pmWhite, pmNop, pmNot, pmCopy, pmNotCopy, pmMergePenNot, pmMaskPenNot, pmMergeNotPen, pmMaskNotPen, pmMerge, pmNotMerge, pmMask, pmNotMask, pmXor, pmNotXor };

Description

TPenMode indicates how a pen color interacts with the color of the canvas it is writing on. The following table lists the possible values:

Mode Pixel color

pmBlack Always black
pmWhite Always white
pmNop Unchanged
pmNot Inverse of canvas background color
pmCopy Pen color specified in Color property
pmNotCopy Inverse of pen color
pmMergePenNot Combination of pen color and inverse of canvas background
pmMaskPenNot Combination of colors common to both pen and inverse of canvas background.
pmMergeNotPen Combination of canvas background color and inverse of pen color
pmMaskNotPen Combination of colors common to both canvas background and inverse of pen

pmMerge Combination of pen color and canvas background color
pmNotMerge Inverse of pmMerge: combination of pen color and canvas background color
pmMask Combination of colors common to both pen and canvas background
pmNotMask Inverse of pmMask: combination of colors common to both pen and canvas background
pmXor Combination of colors in either pen or canvas background, but not both
pmNotXor Inverse of pmXor: combination of colors in either pen or canvas background, but not both
Having that in mind it works fine for me here using something like this:

Code: Select all

        ChartTool1->Pen->Color=clRed;
        ChartTool1->Pen->Mode=pmCopy;
If the problem persists, could you please send us an example we can run "as-is" to reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Posted: Thu Mar 23, 2006 1:07 pm
by 9345036
I can send a sample but it can be seen in design time too.

- Define a series of type fastline, linepen color is clRed, set linepen width to 10
- Define a cursor tool, set pen color to clBlue, set pen width to 10

Look, what happens, if cursor line crosses series: the crossed area gets green.
pmCopy Pen color specified in Color property
pmMerge Combination of pen color and canvas background color
My understanding of pmCopy is, that the crosspoint keeps blue (cursor is in foreground). But the colors are merged or combined in another way.

Posted: Tue Mar 28, 2006 12:02 pm
by 9345036
Hello Steema support,

can you confirm, that cursor pen mode is not pmCopy, when you follow my description?
- Define a series of type fastline, linepen color is clRed, set linepen width to 10
- Define a cursor tool, set pen color to clBlue, set pen width to 10

Posted: Wed Mar 29, 2006 12:22 pm
by 9345036
I looked into your source code and found in TCursorTool.RedrawCursor that you set Pen.Mode:=pmXor before drawing the cursor line.

That's why cursors are not drawn with pmCopy! Can you confirm this? When will this bug be fixed?

Posted: Mon Apr 03, 2006 1:48 pm
by Pep
Hi,

yes, you're correct, the Pen.Mode is not considered. I've wirted down our defect/wish list so this can be changed for further releases.
Thanks for the advise !