Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Saving a screenshot in Asphyre Extreme?

  1. #1

    Saving a screenshot in Asphyre Extreme?

    How would I go about saving a BMP screen shot during my game?

  2. #2
    Aspyhyre eXtreme has component named TAsphyreScreener which you can use to take screenshots of your game. It alows saving screenshots in JPG format.

  3. #3
    Doesn't Asphyre render to object's TCanvas? If that's so, you could make invisible TImage, copy content of render target object into TImage's canvas (after setting proper dimensions of TImage.Picture.Bitmap), then use Image.picture.savetofile? That won't constrict you to jpeg (which is TERRIBLE format for screenshots), but will allow to save to any format Delphi/Lazarus (dunno which one you're using) supports, which includes PNG.

  4. #4
    Asphyre uses TAsphyreCanvas and not regular pascal TCanvas.
    I think that TAsphyreCanvas is named like so only becouse it also supports several similar drawing fuctions (DrawLine, DrawEclipse, DrawPicture instead of DrawGrapgic, etc.) like normal canvas does but it doesn't support direct saving of its contents into files.

  5. #5
    But can't content of TAsphyreCanvas be copied to regular canvas?

    Even if you'd do this pixel-by-pixel (getting pixel's x/y and putting this pixel into normal canvas at proper positions) it shouldn't take long. Unless there is some blitting function to copy from AsphyreCanvas into regular one and vice versa - then it is even faster.

    Anyway, JPG is terrible for screenshots as I said earlier and I strongly recommend trying other means to save it at least to bmp (you can then open this bmp with invisible TImage, save as png and remove bmp file to save space).

  6. #6
    Quote Originally Posted by Darkhog View Post
    But can't content of TAsphyreCanvas be copied to regular canvas?
    Not easily. You see content of TAsphyreCanvas is a TDXTexture which is saved in graphical memory itself. Now if you would be exporting this content your would first need to chage its type as the Textures saved in graphical memory are not in same format as ordinary TCanvas or TBitmap uses.

    Anywhay if you are so against JPG images I'm sure it would be much easier to change the mentioned component itself so it would be able to store the image in different format. I'm sure JPG was used as both Delphi and FPC come out with JPEG file format support so you don't need any third party units or components for it to work.

    EDIT: Just checked the source code of TScreener component and it could be easily modified to also save screenshots in other formats including (BMP, TGA, JPEG, PNG).
    Now I'm not sure that all of theese formats are enabled by default or need some atitional external libraries but it is doable with only a slight change in components code.
    Last edited by SilverWarior; 14-06-2013 at 09:29 PM.

  7. #7
    I'm not against JPEG by itself, but lossy compression in general - it might be good for photos, but for screenshots it is terrible.

  8. #8
    Quote Originally Posted by Darkhog View Post
    I'm not against JPEG by itself, but lossy compression in general - it might be good for photos, but for screenshots it is terrible.
    That laregly depends on compression level and the picture itself.

  9. #9
    Thanks for the replies.

    I hadn't even seen TAsphyreScreener ! Just what I needed. It actually seems to automatically save in .JPG or .BMP depending on the file extension you specify as the filename. Brilliant stuff!

  10. #10
    I have been using TAsphyreScreener to take a screenshot but occasionally it just grabs a blank (black) screen. Anybody else had this problem?

Page 1 of 2 12 LastLast

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
  •