Ver Mensaje Individual
  #4  
Antiguo 21-03-2007
Avatar de seoane
[seoane] seoane is offline
Miembro Premium
 
Registrado: feb 2004
Ubicación: A Coruña, España
Posts: 3.717
Reputación: 24
seoane Va por buen camino
Bien, escaneas la imagen. Cuando la escaneas la pasas directamente al programa o la guardas primero en un bmp. Si es lo segundo puedes usar este código:
Código Delphi [-]
procedure GetBitmapInfo(Filename: string; var Info: BITMAPINFOHEADER);
begin
  FillChar(Info,Sizeof(Info),0);
  with TFileStream.Create(Filename,fmOpenRead,fmShareDenyWrite) do
  try
    Seek(Sizeof(BITMAPFILEHEADER),soFromBeginning);
    ReadBuffer(Info,Sizeof(Info));
  finally
    Free;
  end;
end;

// Por ejemplo
var
  Info: BITMAPINFOHEADER;
  Str: string;
begin
  GetBitmapInfo('c:\1.bmp',Info);
  Str:=
    'Ancho = ' + IntToStr(Info.biWidth) + #13 +
    'Alto = ' + IntToStr(Info.biHeight) + #13 +
    'Profundidad en bits = ' + IntToStr(Info.biBitCount) + #13 +
    'Resolucion horizontal = ' + IntToStr(Info.biXPelsPerMeter) + ' Pixeles por metro' + #13 +
    'Resolucion vertical = ' + IntToStr(Info.biYPelsPerMeter) + ' Pixeles por metro' + #13;
  case Info.biCompression of
    BI_RGB: Str:= Str + 'Compresion = Sin comprimir';
    BI_RLE8: Str:= Str + 'Compresion = RL8';
    BI_RLE4: Str:= Str + 'Compresion = RLE4';
    BI_BITFIELDS: Str:= Str + 'Compresion = BITFIELDS';
  end;
  ShowMessage(Str);
end;
si te fijas uno de los parámetros que podemos obtener del bitmap son los "Píxeles por metro", que creo que es lo que estas buscando.

¿Te sirve o buscamos por otro lado?
Responder Con Cita