示例#1
0
 public void LogSize(Size pixelCount, BinaryWriter binWrite, TextWriter tw, string name)
 {
     binWrite.Write(pixelCount.Width);
     tw.WriteLine("{0} Width: {1}", name, pixelCount.Width);
     binWrite.Write(pixelCount.Height);
     tw.WriteLine("{0} Height: {1}", name, pixelCount.Height);
 }
示例#2
0
        public BlockMap(Size pixelSize, int maxBlockSize)
        {
            PixelCount = pixelSize;
            BlockCount = new Size(
                Calc.DivRoundUp(PixelCount.Width, maxBlockSize),
                Calc.DivRoundUp(PixelCount.Height, maxBlockSize));
            CornerCount = BlockToCornerCount(BlockCount);

            AllBlocks = new RectangleC(BlockCount);
            AllCorners = new RectangleC(CornerCount);

            Corners = InitCorners();
            BlockAreas = new RectangleGrid(Corners);
            BlockCenters = InitBlockCenters();
            CornerAreas = InitCornerAreas();
        }
示例#3
0
 public BinaryMap(Size size)
     : this(size.Width, size.Height)
 {
 }
示例#4
0
 static Size CornerToBlockCount(Size CornerCount)
 {
     return new Size(CornerCount.Width - 1, CornerCount.Height - 1);
 }
示例#5
0
 static Size BlockToCornerCount(Size BlockCount)
 {
     return new Size(BlockCount.Width + 1, BlockCount.Height + 1);
 }
示例#6
0
 public PointGrid(Size size)
 {
     AllX = new int[size.Width];
     AllY = new int[size.Height];
 }
示例#7
0
 public void LogSize(Size pixelCount, BinaryWriter binWrite, TextWriter tw, string name)
 {
     binWrite.Write(pixelCount.Width);
     tw.WriteLine("{0} Width: {1}", name, pixelCount.Width);
     binWrite.Write(pixelCount.Height);
     tw.WriteLine("{0} Height: {1}", name, pixelCount.Height);
 }