Canvas BackGround color when zoomed
Posted: Fri Nov 12, 2004 1:38 pm
Hello,
I can't display the canvas background color when the object is zoomed. In that case, the rectangle background isn't opaque as it is when no zoom is applying.
Here is the code to display the canvas text into a rectangle:
// --------------
// Maximum width
int nWidthMax = 0;
for (int k = 0; k < NB_TOOLTIP_STR; k++) {
int nWidth = cCanvas.TextWidth( cs[k]);
if (nWidth > nWidthMax) nWidthMax = nWidth;
}
CPen1 cPen = cCanvas.GetPen();
cCanvas.SetBackMode( cbmOpaque);
cPen.SetColor( COL_BLACK);
cCanvas.SetBackColor( COL_WHITE);
cCanvas.Rectangle( X+5, Y-5, X+15+nWidthMax, Y + 10 + (NB_TOOLTIP_STR*nLineHeight));
for (k = 0; k < NB_TOOLTIP_STR; k++) {
cCanvas.TextOut( X+10, Y, cs[k]);
Y += nLineHeight;
}
Is something missing ?
I can't display the canvas background color when the object is zoomed. In that case, the rectangle background isn't opaque as it is when no zoom is applying.
Here is the code to display the canvas text into a rectangle:
// --------------
// Maximum width
int nWidthMax = 0;
for (int k = 0; k < NB_TOOLTIP_STR; k++) {
int nWidth = cCanvas.TextWidth( cs[k]);
if (nWidth > nWidthMax) nWidthMax = nWidth;
}
CPen1 cPen = cCanvas.GetPen();
cCanvas.SetBackMode( cbmOpaque);
cPen.SetColor( COL_BLACK);
cCanvas.SetBackColor( COL_WHITE);
cCanvas.Rectangle( X+5, Y-5, X+15+nWidthMax, Y + 10 + (NB_TOOLTIP_STR*nLineHeight));
for (k = 0; k < NB_TOOLTIP_STR; k++) {
cCanvas.TextOut( X+10, Y, cs[k]);
Y += nLineHeight;
}
Is something missing ?