Registriert seit: 19. Jan 2003
732 Beiträge
Turbo Delphi für Win32
|
Re: Bitmap in Din A4 Größe
15. Mär 2008, 19:05
Delphi-Quellcode:
const MMPerInch: Extended = 25.4;
//Liefert Desktop-Auflösung
function GetXDPI: Integer;
var
ScreenDC: Cardinal;
begin
ScreenDC := GetWindowDC(GetDesktopWindow);
Result := IntToStr(GetDeviceCaps(ScreenDC, LOGPIXELSX));
ReleaseDC(GetDesktopWindow, ScreenDC);
end;
procedure DinFormatToMM(DinAx: Integer; var rPoint: TPoint);
var
i: Integer;
X, Y: Double;
begin
//A0 Format
X := 841;
Y := 1189;
for i:=0 to DinAx-1 do
if X > Y then X := X / 2 else Y := Y / 2;
rPoint.X := Round(X);
rPoint.Y := Round(Y);
end;
procedure DinFormatToPixels(DinAx, XDPI, YDPI: Integer;
var rPoint: TPoint);
begin
DinFormatToMM(DinAx, rPoint);
rPoint.X := Round((rPoint.X / MMPerInch)* XDPI);
rPoint.Y := Round((rPoint.Y / MMPerInch)* YDPI);
end;
Dani H. At Least I Can Say I Tried
|
|
Zitat
|