Пример #1
0
 public void GraphicsTest()
 {
     using (BitmapLoader loader = new BitmapLoader(this.smallBitmap))
     {
         Assert.IsNotNull(loader.Graphics);
     }
 }
Пример #2
0
 public void Scan0Test()
 {
     using (BitmapLoader loader = new BitmapLoader(this.smallBitmap))
     {
         Assert.AreNotEqual(IntPtr.Zero, loader.Scan0);
     }
 }
Пример #3
0
 public void BaseBitmapTest()
 {
     using (BitmapLoader loader = new BitmapLoader(this.smallBitmap))
     {
         Assert.IsNotNull(loader.BaseBitmap);
         Assert.AreEqual(this.smallBitmap, loader.BaseBitmap);
     }
 }
Пример #4
0
        /// <summary>
        /// テキストオプションと描画先のビットマップを指定して
        /// 新しい TextRenderer クラスの新しいインスタンスを初期化します。
        /// </summary>
        /// <param name="options">使用されるテキストオプション。</param>
        /// <param name="bitmapLoader">描画先のビットマップ。</param>
        /// <exception cref="ArgumentNullException">何れかの引数が null です。</exception>
        public TextRenderer(TextRendererOptions options, BitmapLoader bitmapLoader)
        {
            if (options == null)
                throw new ArgumentNullException("options");

            if (bitmapLoader == null)
                throw new ArgumentNullException("bitmapLoader");

            this.options = options;
            this.loader = bitmapLoader;
        }
Пример #5
0
        /// <summary>
        /// このオブジェクトによって使用されているアンマネージリソースを解放し、オプションでマネージリソースも解放します。
        /// </summary>
        /// <param name="disposing">
        /// マネージリソースとアンマネージリソースの両方を解放する場合は true。アンマネージリソースだけを解放する場合は false。
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (!this.isDisposed)
            {
                if (disposing)
                {
                    if (this.loader != null)
                        this.loader.Dispose();

                    if (this.options != null)
                        this.options.Dispose();
                }

                this.loader = null;
                this.options = null;

                this.isDisposed = true;
            }
        }