Einzelnen Beitrag anzeigen

mr_emre_d
(Gast)

n/a Beiträge
 
#8

Re: Neue Btmap in Millimiter statt in Pixel erstellen ?

  Alt 5. Feb 2009, 12:51
Lol, dass sind ja wunderbare / hilfreiche Antworten

hier mal n Codeschnipsel:
Delphi-Quellcode:
function CmToPixel(Cm: Single): Single;
var
  DC : Cardinal;
  DPI: Cardinal;
// Info: DPI 72:
// 1 cm = 28.35 Pixel;
begin
  Result := 0;
  DC := GetDC(GetDesktopWindow());
  DPI := GetDeviceCaps(DC,LOGPIXELSY);
  ReleaseDC(DC,GetDesktopWindow());
  if DPI = 0 then
    Exit;
  Result := CM * 28.35 / 72 * DPI;
end;
  Mit Zitat antworten Zitat