Ver Mensaje Individual
  #32  
Antiguo 27-08-2008
Cesar Junior Cesar Junior is offline
Miembro
 
Registrado: ago 2007
Posts: 24
Reputación: 0
Cesar Junior Va por buen camino
Y quedo asi
Código Delphi [-]
 
procedure TForm1.Rellena_colonia(i,j : integer; col,rel : TColor; im : TImage);
begin
        Im.Canvas.Brush.Color := rel;
        Im.Canvas.FloodFill(i,j,col,fsSurface);
end;
 
 
procedure TForm1.BitBtn6Click(Sender: TObject);
var
        i,j : integer;
        colonias : integer;
begin
        colonias := 0;
        for i := 0 to Image1.Width do
        for j := 0 to Image1.Height do
        if Image1.Canvas.Pixels[i,j] = clWhite then
        begin
             rellena_colonia(i,j,clWhite,clRed,Image1);
             inc(colonias);
        end;
        Label2.Caption := inttostr(colonias);
        Label2.Visible:=true;
        ShowMessage(inttostr(Colonias));
end;

Esto funciona mui bien, cuando la imagen esta bien definida
Responder Con Cita