Beispiel #1
0
 internal void UpdateForegroundColor(EMFColor newColor)
 {
     m_currentContext.textColor = newColor.ColorRef;
 }
Beispiel #2
0
        public void AddFilledArea(Rectangle rect)
        {
            // add these in as default colour
            SaveContext();
            EMFColor newColor = new EMFColor(null);
            newColor.ColorRef = Color.FromArgb(0, 192, 192, 192);
            int iMaxWidthConsidered = 4;

            // TODO: process the areas later after knowq have read all texts wetc in
            if (m_bIgnoreUnscaledLines)    
            {
                if (m_textRecords[0].Text.Bounds.Height > 50) // big text => wider lines
                {
                    iMaxWidthConsidered = m_textRecords[0].Text.Bounds.Height / 10;
                }
            }

            bool bIgnoreUnscaledLinesStash = m_bIgnoreUnscaledLines;
            m_bIgnoreUnscaledLines = false;

            if (rect.Width <= iMaxWidthConsidered || rect.Height <= iMaxWidthConsidered)    // 0 and 1 width taken out already
            {
                // is thick border
                if (!bIgnoreUnscaledLinesStash) // unless scaled up -> then treat as normal
                    m_borderAreas.Add(new FilledArea(rect, m_currentContext.textColor));

                // also add in as single lines in default colour for cell calculations
                UpdateForegroundColor(newColor);
                if (rect.Width <= iMaxWidthConsidered)
                    RecordLine(new Point(rect.Left, rect.Top), new Point(rect.Left, rect.Bottom));
                else
                    RecordLine(new Point(rect.Left, rect.Top), new Point(rect.Right, rect.Top));
            }
            else
            {
                m_filledAreas.Add(new FilledArea(rect, m_currentContext.textColor));

                UpdateForegroundColor(newColor);

                if (m_currentContext.textColor != Color.White)
                {
                    // still not sure about adding these in.  Not necessarily related to lines
                    // still, wait til proved otherwise...
                    rect.Inflate(1, 1);
                    RecordLine(new Point(rect.Left, rect.Top), new Point(rect.Right, rect.Top));
                    RecordLine(new Point(rect.Left, rect.Top), new Point(rect.Left, rect.Bottom));
                    RecordLine(new Point(rect.Left, rect.Bottom), new Point(rect.Right, rect.Bottom));
                    RecordLine(new Point(rect.Right, rect.Top), new Point(rect.Right, rect.Bottom));
                }
            }
            m_bIgnoreUnscaledLines = bIgnoreUnscaledLinesStash;
            RestoreContext(-1);
        }
Beispiel #3
0
 internal void UpdateBackgrounColor(EMFColor newColor)
 {
     m_currentContext.backColor = newColor.ColorRef;
 }
Beispiel #4
0
        private EMFColor DecodeColor(int flags, byte[] dataArray)
        {
            EMFColor color = new EMFColor(new DataArrayReader(dataArray));

			return color;
        }