Exemplo n.º 1
0
        //============================================================
        // <T>更新属性。</T>
        //============================================================
        public void Update()
        {
            // 测试有效区域
            SIntRectangle rect = new SIntRectangle();

            RBitmap.TestValidRectangle(_bitmap, rect, _validAlpha);
            // 设置属性
            _size.Set(_bitmap.Width, _bitmap.Height);
            _validLocation.Set(rect.Left, rect.Top);
            _validSize.Set(rect.Width, rect.Height);
        }
Exemplo n.º 2
0
 //============================================================
 // <T>打开资源。</T>
 //============================================================
 public override void Open()
 {
     if (!_statusOpen)
     {
         base.Open();
         // 打开图片资源
         _bitmap.LoadFile(_fileName);
         int length = (int)RFile.GetFileLength(_fileName);
         _size.Width  = _bitmap.Width;
         _size.Height = _bitmap.Height;
         // 测试有效区域
         RBitmap.TestValidRectangle(_bitmap.Native, _validRectangle, _qualityAlpha);
     }
 }