Autor Beitrag
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Sa 05.11.05 14:08 
Ist es möglich von einem kompletten StringGrid einen Screenshot mit einem mal zu machen? Denn mein Problem ist, dass ich nicht das gesamte StringGrid mit einem mal auf den Bildschirm bekomme, so dass ich mehrere Screenshouts machen müsste.
Aso zu bemerken ist noch, dass ich bei OnDrawCell immer etwas darauf male, wodurch ich nicht die Inhalte der Liste auslesen kann und sie dann als txt zu speichern (des wegen will ich es ja als ein Bild ;) ).

mfg
Heiko
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: So 06.11.05 11:24 
Naja hatte es dir in MSN schon gesagt, wollen wir das dem forum nicht vorenthalten. Ich hoffe es funktioniert:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
Procedure MakeScreenShotFromHandle(HWND: THandle);
Var
    DC: HDC;
    R: TRect;
    iwidth, iheight: Integer;
    bm: TBitmap;
Begin
    bm := TBitmap.Create;

    DC := GetWindowDC(HWND);
    GetWindowRect(HWND, R);
    iwidth := R.Right - R.Left;
    iheight := R.Bottom - R.Top;

    bm.Width := iwidth;
    bm.Height := iheight;

    BitBlt(bm.Canvas.Handle, 0, 0, iwidth, iheight, DC, 0, 0, SRCCOPY);
    bm.SaveToFile('C:\abc.bmp');
    bm.Free;
    DeleteDC(DC);
End;


Vielleicht musste noch nen try..except block reinmachen.

mfg matze


//Edit: Habs getestet, klappt os nicht, er geht nicht über den Bildschirmrand hinaus...

_________________
si tacuisses, philosophus mansisses.
Heiko Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: So 06.11.05 11:37 
user profile iconmatze.de hat folgendes geschrieben:
//Edit: Habs getestet, klappt os nicht, er geht nicht über den Bildschirmrand hinaus...


Das ist ja das problem, woran ich scheitere ;).
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: So 06.11.05 13:56 
Screenshot wird wohl so nichts werden.

www.swissdelphicente...showcode.php?id=1577

_________________
Gruß
Hansa
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 19.12.05 09:01 
Hallo,

eine Lösung gibt es in der Delphi - Library:
... ein Stringgrid als Bitmap ausgeben/speichern

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )