Ver Mensaje Individual
  #7  
Antiguo 03-10-2011
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola Parsec.

Ya lo mencionó escafandra más arriba, pero como está codificado en C++ quizá no lo hayas podido probar.

Este código funciona razonablemente bién:
Código Delphi [-]
procedure AdaptarResolucion(AForm: TForm; Alto,Ancho: Integer);
begin
  with AForm do
  begin
    if Screen.PixelsPerInch = 96 then
    begin
      ClientHeight := ClientHeight * Screen.Height div Alto;
      ClientWidth := ClientWidth * Screen.width div Ancho;
      ScaleBy(Screen.Width, Ancho);
    end
    else if Screen.PixelsPerInch = 120 then
    begin
      ClientHeight := ClientHeight * Screen.Height div Alto;
      ClientHeight := ClientHeight + ((ClientHeight*15) div 100);
      ClientWidth := ClientWidth * Screen.Width div Ancho;
      ClientWidth := ClientWidth + ((ClientWidth*15) div 100);
      ScaleBy(Screen.Width,Ancho);
      Top := Top - 70;
      Left := Left - 70;
    end
    else
    begin
      ClientHeight := ClientHeight * Screen.Height div Alto;
      ClientWidth := ClientWidth * Screen.width div Ancho;
      ScaleBy(Screen.Width,Ancho);
    end;
  end;
end;

Ejemplo de llamada:
Código Delphi [-]
   AdaptarResolucion(Form1, 768, 1024);


Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....

Última edición por ecfisa fecha: 03-10-2011 a las 14:07:38. Razón: Agregar ejemplo de llamada
Responder Con Cita