![]() |
Probleme mit Screenshots
Hallo!
Ich habe ein kleines Problem mit dem schießen von Screenshots.Ich benutze die Komponente "Embedded Web Browser Components Package" ( ![]() Das Problem ist das ich das Programm auf einem Server mit einer Windows2005 Server Webedition laufen lasse, und dieser Server zeigt zwar alles per Remote Desktop in Farbe an, aber "local" arbeitet der Server leider nur mit sehr wenigen Farben, so das die Thumbs nur in Schwarz/Weiß gemacht werden. Hier ist die betreffende Function der Komponente (EWBTools.pas):
Delphi-Quellcode:
function GetJPEGfromBrowser(Document: IDispatch; ControlInterface: IWebBrowser2; FileName: string; SourceHeight, SourceWidth,
TargetHeight, TargetWidth: Integer): Boolean; var sourceDrawRect: TRect; targetDrawRect: TRect; sourceBitmap: Graphics.TBitmap; targetBitmap: Graphics.TBitmap; aJPG: TJPEGImage; aViewObject: IViewObject; IWeb: IWebBrowser2; begin Result := False; sourceBitmap := Graphics.TBitmap.Create; targetBitmap := Graphics.TBitmap.Create; aJPG := TJPEGImage.Create; IWeb := ControlInterface; try try sourceDrawRect := Rect(0, 0, SourceWidth, SourceHeight); sourceBitmap.Width := SourceWidth; sourceBitmap.Height := SourceHeight; aViewObject := IWeb as IViewObject; if aViewObject = nil then Exit; OleCheck(aViewObject.Draw(DVASPECT_CONTENT, 1, nil, nil, Forms.Application.Handle, sourceBitmap.Canvas.Handle, @sourceDrawRect, nil, nil, 0)); targetDrawRect := Rect(0, 0, TargetWidth, TargetHeight); targetBitmap.Height := TargetHeight; targetBitmap.Width := TargetWidth; targetBitmap.Canvas.StretchDraw(targetDrawRect, sourceBitmap); aJPG.Assign(targetBitmap); aJPG.SaveToFile(FileName); Result := True; finally aJPG.Free; sourceBitmap.Free; targetBitmap.Free; end; except Result := False; end; end; Hat vieleicht jemand eine Idee wie ich Farbige Thumbs erstellen kann, auch wenn der Server mit so wenigen Farben arbeitet ??? |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:33 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz