Exemplo n.º 1
0
        /// <summary>
        /// Draws the specified <see cref="CatalogManager.Catalog"/> tile to the <see
        /// cref="PaintBuffer"/>, with alpha blending and color substitution.</summary>
        /// <param name="dest">
        /// The location within the <see cref="PaintBuffer"/> where to draw.</param>
        /// <param name="region">
        /// The bitmap region within the <see cref="CatalogManager.Catalog"/> to copy, relative to
        /// the tile with the specified <paramref name="index"/>.</param>
        /// <param name="index">
        /// The <see cref="CatalogManager.Catalog"/> index of the tile to draw.</param>
        /// <param name="color">
        /// The <see cref="Color"/> whose color channels are substituted for those of all <see
        /// cref="CatalogManager.Catalog"/> pixels, retaining only their alpha channel.</param>

        private void DrawTile(PointI dest, RectI region, int index, Color color)
        {
            // add upper-left corner of catalog tile
            region = region.Offset(MapView.GetTileLocation(index));

            // copy visible part of catalog tile to buffer
            PaintBuffer.Overlay(dest.X, dest.Y, MapView.Catalog, region, color);
        }
Exemplo n.º 2
0
 public void Offset()
 {
     Assert.AreEqual(new RectD(4, 6, 4, 5), rectD.Offset(new PointD(3, 4)));
     Assert.AreEqual(new RectF(4, 6, 4, 5), rectF.Offset(new PointF(3, 4)));
     Assert.AreEqual(new RectI(4, 6, 4, 5), rectI.Offset(new PointI(3, 4)));
 }