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.