iTextSharp.text.Image.ScalePercent C# (CSharp) Метод

ScalePercent() публичный Метод

Scale the image to a certain percentage.
public ScalePercent ( float percent ) : void
percent float the scaling percentage
Результат void
        public void ScalePercent(float percent)
        {
            ScalePercent(percent, percent);
        }

Same methods

Image::ScalePercent ( float percentX, float percentY ) : void

Usage Example

Пример #1
0
        private void AddCover()
        {
            try
            {
                byte[] cover = WebCrawler.DownloadCover(lnParameters.urlCover);

                PdfImage pic = PdfImage.GetInstance(cover);

                if (pic.Height > pic.Width)
                {
                    //Maximum height is 800 pixels.
                    float percentage = 0.0f;
                    percentage = 700 / pic.Height;
                    pic.ScalePercent(percentage * 100);
                }
                else
                {
                    //Maximum width is 600 pixels.
                    float percentage = 0.0f;
                    percentage = 540 / pic.Width;
                    pic.ScalePercent(percentage * 100);
                }

                pic.Border      = Rectangle.BOX;
                pic.BorderColor = BaseColor.BLACK;
                pic.BorderWidth = 3f;
                pdf.NewPage();
                pdf.Add(pic);
            }
            catch (CoverException)
            {}
        }
All Usage Examples Of iTextSharp.text.Image::ScalePercent