Autor Beitrag
Bobo220673
Hält's aus hier
Beiträge: 1



BeitragVerfasst: So 22.10.06 16:34 
Hallo!
Ich habe ein kleines Problem mit dem schießen von Screenshots.Ich benutze die Komponente "Embedded Web Browser Components Package" (www.bsalsa.com/downloads.html) zum erstellen von Thumbs einer Webseite.
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):

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
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(00, SourceWidth, SourceHeight); 
      sourceBitmap.Width := SourceWidth; 
      sourceBitmap.Height := SourceHeight; 
      aViewObject := IWeb as IViewObject; 
      if aViewObject = nil then Exit; 
      OleCheck(aViewObject.Draw(DVASPECT_CONTENT, 1nilnil
        Forms.Application.Handle, 
        sourceBitmap.Canvas.Handle, 
        @sourceDrawRect, nilnil0)); 
      targetDrawRect := Rect(00, 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 ???