Results 1 to 4 of 4

Thread: Screen shots

  1. #1
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Screen shots

    I'm using the standard DXDraw component. How do I generate a Screen Dump of my screen? I could do it pixel by pixel but I'm sure there is an easier way.

    All I want is a bmp file on my harddrive when the user presses a key....

    Cheers
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  2. #2

    Screen shots

    theoretically you could use the handle (think DXDraw has one) of the TDXDraw component and use the same method used to make a screenshot, but instead of the Desktop Handle you simply use the TDXDraw handle...

    I never did this so it's all just theoretically...

    Another solution might be the DXDraw surface, I'm not sure (I have computer problems on my pc with Delphi on it, so I can't look cq. test it) but I think it has the SaveToFile option, like the TBitmap component.
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

  3. #3
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Screen shots

    Found the way

    B := TBitMap.Create;
    B.Width := VideoModeX;
    B.Height := VideoModeY;
    B2 := TBitMap.Create;
    B2.Width := VideoModeX div 2;
    B2.Height := VideoModeY div 2;
    B.Canvas.CopyRect(Rect(0,0,VideoModeX-1, VideoModeY-1),DXDraw1.Surface.Canvas,Rect(0,0,VideoModeX-1, VideoModeY-1));
    B2.Canvas.StretchDraw(Rect(0,0,B2.Width-1, B2.Height-1), B);
    B.SaveToFile('TEST.BMP');
    B2.SaveToFile('TestSmall.bmp');
    B.Free;
    B2.Free;

    Works well with hardly a flicker on the screen.

    If someone can tell me how to post an image I'll put a screen dump of two on the projects forum.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  4. #4

    Screen shots

    Quote Originally Posted by cairnswm
    If someone can tell me how to post an image I'll put a screen dump of two on the projects forum.
    You'll need to upload it to some webspace, then use:


    P.S. Remember to call DXDraw1.Surface.Release after using the Canvas.
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •