CSReportPaint.cReportPrint.m_rpwPrint_ChangeZoom C# (CSharp) Метод

m_rpwPrint_ChangeZoom() приватный Метод

private m_rpwPrint_ChangeZoom ( int zoom ) : void
zoom int
Результат void
        private void m_rpwPrint_ChangeZoom(int zoom)
        {
            float nZoom = 0;
            float width = 0;
            float height = 0;

            switch (zoom)
            {
                case (int)csEZoom.csEZoomAllPage:

                    width = m_rpwPrint.Width / m_realWidth;
                    height = m_rpwPrint.Height / m_realHeight;

                    if (width < height)
                    {
                        nZoom = m_rpwPrint.Width / m_realWidth;
                    }
                    else
                    {
                        nZoom = m_rpwPrint.Height / m_realHeight;
                    }

                    break;
                case (int)csEZoom.csEZoomCustom:
                    nZoom = 1;
                    break;
                case (int)csEZoom.csEZoomWidth:
                    nZoom = m_rpwPrint.Width / m_realWidth;
                    break;
                default:
                    nZoom = zoom / 100;
                    break;
            }

            if (nZoom < 0.01) { nZoom = 0.01f; }

            PictureBox pic = m_rpwPrint.getBody();
            pic.Width = (int)(m_realWidth * nZoom);
            pic.Height = (int)(m_realHeight * nZoom);

            if (nZoom > 0.5)
            {
                m_paint.setZoom(100);
                m_paint.setScaleX(nZoom);
                m_paint.setScaleY(nZoom);
                m_scaleFont = nZoom;
                printPage(m_currPage);
            }
            else
            {
                m_paint.setZoom(zoom);
                m_rpwPrint.getBody().Refresh();
            }
        }