Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Gráficos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 20-02-2011
CCCP CCCP is offline
Miembro
 
Registrado: dic 2004
Ubicación: Barcelona
Posts: 38
Poder: 0
CCCP Va por buen camino
a ver si te vale

Código Delphi [-]
procedure GrayScale(PICT: TPicture);
  const
    MaxPixelCount = 32768;
  type
    pRGBArray = ^TRGBArray;
    TRGBArray = ARRAY[0..MaxPixelCount-1] of TRGBTriple;
  var
    i, j, Colr : Integer;
    sl : pRGBArray;  // Scanline
    bmp : TBitmap;
  begin
    bmp := TBitmap.Create;
    try
      bmp.PixelFormat := pf24bit;
      bmp.Width := PICT.Graphic.Width;
      bmp.Height := PICT.Graphic.Height;
      bmp.Canvas.Draw(0,0,PICT.Graphic);
      if bmp.PixelFormat <> pf24bit then begin
        // ShowMessage('Not a 24Bit color bitmap!');
        Exit;
      end;
      for j:=0 to bmp.Height-1 do begin
        sl := bmp.ScanLine[j];
        for i:=0 to bmp.Width-1 do begin
          Colr:=HiByte(sl[i].rgbtRed * 77 + sl[i].rgbtGreen * 151 +
             sl[i].rgbtBlue * 28);
          sl[i].rgbtRed := Colr;
          sl[i].rgbtGreen := Colr;
          sl[i].rgbtBlue := Colr;
        end;
      end;
      PICT.Assign(bmp);
    finally
      bmp.Free;
    end;
  end;

Última edición por ecfisa fecha: 21-02-2011 a las 11:46:10. Razón: ETIQUETAS DELPHI
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 22:32:27.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi