public List <Rectangle> GenerarColeccionDeContenedores(IFragmento fragmento) { this.fragmentoPrincipal = fragmento; this.imagenCompleta = fragmento.ImagenContenedoraWrapper; Size tamañoContenedor = new Size(fragmento.ImagenWrapper.Width * 5, fragmento.ImagenWrapper.Height * 5); int posicionX = 0; int posicionY = 0; bool finalDeImagenY = false; bool areaCubierta = false; List <Rectangle> contenedores = new List <Rectangle>(); while (!areaCubierta) { Rectangle contenedor = new Rectangle(new Point(posicionX, posicionY), tamañoContenedor); contenedores.Add(contenedor); posicionX = posicionX + tamañoContenedor.Width / 2; if (posicionX > this.imagenCompleta.Width) { posicionX = this.imagenCompleta.Width - tamañoContenedor.Width; if (!finalDeImagenY) { posicionY = posicionY + tamañoContenedor.Height / 2; if (posicionY > this.imagenCompleta.Height) { posicionY = this.imagenCompleta.Height - tamañoContenedor.Height; finalDeImagenY = true; } } else { areaCubierta = true; } } } return(contenedores); }
public FragmentoParaAnalisisWrapper(IFragmento fragmento, Point ubicacionContenedor, Size tamañoContenedor) : this(fragmento) { this.size = tamañoContenedor; this.location = ubicacionContenedor; }
public FragmentoParaAnalisisWrapper(IFragmento fragmento) { this.Fragmento = fragmento; }
public void Configurar(IFragmento fragmento) { this.Analisis.Fragmento = fragmento; }