Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As you can see in documentation of line, it has only 3 valid types: 4, 8 and 16(CV_AA). Passing any other value as lineType is not legal. But for any line thickness bigger than 1, type of line does not matter (not used, not checked). This is why your program runs fine when thickness = 2 and lineType = 2 which is illegal value. It is checked in only two cases: when thickness is 1, and when it is -1 (since your polygon may have just a single line, filling it is the same as just drawing it with thickness 1).

You can check wikipedia for more information about 4 and 8 connectivity.