private static Rectangle GetBorderPatch(HorizontalSide h, VerticalSide v) { int left = 0; int top = 0; int width = 0; int height = 0; if (h == HorizontalSide.Left) { left = 0; width = BORDER_SIZE; } else if (h == HorizontalSide.Middle) { left = BORDER_SIZE; width = SEAMLESS_SIZE; } else if (h == HorizontalSide.Right) { left = BORDER_IMG_SIZE - BORDER_SIZE; width = BORDER_SIZE; } if (v == VerticalSide.Top) { top = 0; height = BORDER_SIZE; } else if (v == VerticalSide.Middle) { top = BORDER_SIZE; height = SEAMLESS_SIZE; } else if (v == VerticalSide.Bottom) { top = BORDER_IMG_SIZE - BORDER_SIZE; height = BORDER_SIZE; } return(new Rectangle(left, top, width, height)); }
private static Rectangle GetSeamlessPatch(HorizontalSide h, VerticalSide v) { int left = 0; int top = 0; int width = 0; int height = 0; if (h == HorizontalSide.Left) { left = 0; width = CELL_MARGIN; } else if (h == HorizontalSide.Middle) { left = 0; width = SEAMLESS_SIZE; } else if (h == HorizontalSide.Right) { left = SEAMLESS_SIZE - CELL_MARGIN; width = CELL_MARGIN; } if (v == VerticalSide.Top) { top = 0; height = CELL_MARGIN; } else if (v == VerticalSide.Middle) { top = 0; height = SEAMLESS_SIZE; } else if (v == VerticalSide.Bottom) { top = SEAMLESS_SIZE - CELL_MARGIN; height = CELL_MARGIN; } return(new Rectangle(left, top, width, height)); }