Ver Mensaje Individual
  #3  
Antiguo 24-10-2008
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Tal como menciona TOPX, el centrado debes hacerlo en el documento HTML. Puedes intentar esto:

Código Delphi [-]
procedure TForm1.WebBrowser1DocumentComplete(
  Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);
const
  fmtStyle = 'position:absolute;left:50%%;margin-left:-%d;top:50%%;margin-top:-%d;';

var
  Document: IHTMLDocument2;
  Image: IHTMLImgElement;
  Style: String;

begin
  Document := WebBrowser1.Document as IHTMLDocument2;
  Image := Document.images.item(null, 0) as IHTMLImgElement;
  Style := Format(fmtStyle, [Image.width div 2,Image.height div 2]);
  Document.body.innerHTML :=
    '<div style="' + Style + '">' + Document.body.innerHTML + '</div>';
end;

De todas formas, podrías usar lo del hilo que te menciona TOPX: bajar la imagen y colocarla en un componente TImage con su propiedad Center en true.

Nota: El código anterior funciona sólo si la url cargada es directamente la de la imagen.

// Saludos
Responder Con Cita