RaUI/Source/ryControls/HtmlRenderer/Core/Dom/CssRectImage.cs
zilinsoft 3262955f2f ### 2023-11-07更新
------
#### RaUIV4    V4.0.2311.0701
- *.[全新]整合了MyDb、ryControls、MyDb_MySQL等dll文件到RaUI一个项目。
- *.[新增]新增ApkOp类,可以轻松获取APK信息。
- *.[新增]新增JsonExt扩展类,让Json操作更简单。
- *.[新增]新增WebP类,可以支持webp格式的图片。
- *.[改进]ryQuickSQL中的AddField方法改为自动替换已存在的同名值。
- *.[修复]ryQuickSQL中的AddFieldCalc方法无法正常计算的BUG。
2023-11-07 16:37:53 +08:00

81 lines
2.1 KiB
C#

// "Therefore those skilled at the unorthodox
// are infinite as heaven and earth,
// inexhaustible as the great rivers.
// When they come to an end,
// they begin again,
// like the days and months;
// they die and are reborn,
// like the four seasons."
//
// - Sun Tsu,
// "The Art of War"
using TheArtOfDev.HtmlRenderer.Adapters;
using TheArtOfDev.HtmlRenderer.Adapters.Entities;
namespace TheArtOfDev.HtmlRenderer.Core.Dom
{
/// <summary>
/// Represents a word inside an inline box
/// </summary>
internal sealed class CssRectImage : CssRect
{
#region Fields and Consts
/// <summary>
/// the image object if it is image word (can be null if not loaded)
/// </summary>
private RImage _image;
/// <summary>
/// the image rectangle restriction as returned from image load event
/// </summary>
private RRect _imageRectangle;
#endregion
/// <summary>
/// Creates a new BoxWord which represents an image
/// </summary>
/// <param name="owner">the CSS box owner of the word</param>
public CssRectImage(CssBox owner)
: base(owner)
{ }
/// <summary>
/// Gets the image this words represents (if one exists)
/// </summary>
public override RImage Image
{
get { return _image; }
set { _image = value; }
}
/// <summary>
/// Gets if the word represents an image.
/// </summary>
public override bool IsImage
{
get { return true; }
}
/// <summary>
/// the image rectange restriction as returned from image load event
/// </summary>
public RRect ImageRectangle
{
get { return _imageRectangle; }
set { _imageRectangle = value; }
}
/// <summary>
/// Represents this word for debugging purposes
/// </summary>
/// <returns></returns>
public override string ToString()
{
return "Image";
}
}
}