Inheritance: System.Collections.Specialized.NameObjectCollectionBase
Exemplo n.º 1
0
        // Drawing - Primitive
        private bool draw(cReportPaintObjects collObjs, String key, Graphics graph)
        { // TODO: Use of ByRef founded Private Function Draw(ByRef CollObjs As cReportPaintObjects, ByVal Key As String, ByVal hDC As Long, ByRef Graph As Object) As Boolean
            try
            {
                if (graph == null)
                {
                    throw new ReportPaintException(
                        csRptPaintErrors.CSRPT_PAINT_ERR_OBJ_CLIENT,
                        C_MODULE,
                        cReportPaintError.errGetDescript(
                                        csRptPaintErrors.CSRPT_PAINT_ERR_OBJ_CLIENT));
                }

                cReportPaintObject oPaintObj = null;
                float x1 = 0;
                float y1 = 0;
                float y2 = 0;
                float x2 = 0;
                int colorIn = 0;
                int colorOut = 0;
                bool filled = false;

                oPaintObj = collObjs.item(key);

                if (oPaintObj == null) { return false; }

                cReportAspect w_aspect = oPaintObj.getAspect();

                x1 = w_aspect.getLeft();
                x2 = x1 + w_aspect.getWidth();
                y1 = w_aspect.getTop() - w_aspect.getOffset();
                y2 = y1 + w_aspect.getHeight();

                if (!w_aspect.getTransparent())
                {
                    colorIn = w_aspect.getBackColor();
                    filled = true;
                }

                colorOut = w_aspect.getBorderColor();

                switch (oPaintObj.getPaintType())
                {
                    case csRptPaintObjType.CSRPTPAINTOBJBOX:

                        pDrawObjBox(graph,
                                    oPaintObj.getAspect(),
                                    x1, y1, x2, y2,
                                    filled,
                                    colorIn,
                                    colorOut);
                        break;

                    case csRptPaintObjType.CSRPTPAINTOBJLINE:

                        printLine(graph, filled, x1, y1, x2, y2, colorIn, 1, false, colorOut, false);
                        break;

                    case csRptPaintObjType.CSRPTPAINTOBJCIRCLE:
                        break;

                    case csRptPaintObjType.CSRPTPAINTOBJIMAGE:

                        pDrawObjBox(graph,
                                    oPaintObj.getAspect(),
                                    x1 - 1, y1 - 1, x2 + 1, y2 + 1,
                                    filled,
                                    colorIn,
                                    0xC0C000);

                        int bmpWidth = 0;
                        int bmpHeight = 0;

                        if (oPaintObj.getImage() != null)
                        {
                            cGlobals.getBitmapSize(oPaintObj.getImage(), out bmpWidth, out bmpHeight, true);

                            if (bmpWidth > w_aspect.getWidth())
                            {
                                bmpWidth = (int)w_aspect.getWidth();
                            }
                            if (bmpHeight > w_aspect.getHeight())
                            {
                                bmpHeight = (int)w_aspect.getHeight();
                            }

                            drawBMP(graph,
                                    oPaintObj.getImage(),
                                    x1 * m_scaleX,
                                    y1 * m_scaleY,
                                    bmpWidth,
                                    bmpHeight,
                                    bmpWidth * m_scaleX,
                                    bmpHeight * m_scaleY);
                        }
                        break;
                }

                if (oPaintObj.getText() != "")
                {
                    if (collObjs == m_paintObjects)
                    {
                        printText(graph,
                                    oPaintObj.getText(),
                                    oPaintObj.getAspect(),
                                    oPaintObj.getImage());
                    }
                }

                return true;

            }
            catch (Exception ex)
            {
                cError.mngError(ex, "Draw", C_MODULE, "Error al dibujar un objeto");
                return false;
            }
        }
Exemplo n.º 2
0
 private bool pointIsInObjectAux(
     cReportPaintObjects paintObjs,
     float x,
     float y,
     ref String sKey,
     ref csRptPaintRegionType regionType)
 {
     for (int i = paintObjs.count()-1; i > -1; i--)
     {
         if (pointIsInThisObjectAux(paintObjs.getNextPaintObjForZOrder(i), x, y, ref sKey, ref regionType))
         {
             return true;
         }
     }
     return false;
 }