예제 #1
0
 /// <summary>
 /// Assigns words its width and height
 /// </summary>
 /// <param name="g">the device to use</param>
 internal override void MeasureWordsSize(RGraphics g)
 {
     if (!_wordsSizeMeasured)
     {
         MeasureWordSpacing(g);
         _wordsSizeMeasured = true;
     }
     CssLayoutEngine.MeasureImageSize(_imageWord);
 }
예제 #2
0
        /// <summary>
        /// Assigns words its width and height
        /// </summary>
        /// <param name="g">the device to use</param>
        internal override void MeasureWordsSize(RGraphics g)
        {
            if (!_wordsSizeMeasured)
            {
                if (_imageLoadHandler == null && (HtmlContainer.AvoidAsyncImagesLoading || HtmlContainer.AvoidImagesLateLoading))
                {
                    _imageLoadHandler = new ImageLoadHandler(HtmlContainer, OnLoadImageComplete);

                    if (this.Content != null && this.Content != CssConstants.Normal)
                    {
                        _imageLoadHandler.LoadImage(this.Content, HtmlTag != null ? HtmlTag.Attributes : null);
                    }
                    else
                    {
                        _imageLoadHandler.LoadImage(GetAttribute("src"), HtmlTag != null ? HtmlTag.Attributes : null);
                    }
                }

                MeasureWordSpacing(g);
                _wordsSizeMeasured = true;
            }

            CssLayoutEngine.MeasureImageSize(_imageWord);
        }