Computer Science Canada Screen -> File using Hex Output |
Author: | Zren [ Sun Aug 02, 2009 3:47 am ] | ||
Post subject: | Screen -> File using Hex Output | ||
Just because I wanted to see if I could prove DemonWasp wrong in the ability to have screen output writing to file in this thread. http://compsci.ca/v3/viewtopic.php?p=190965#190965 Though I got to admit I've been wondering this for awhile. So I looked into what makes a basic uncompressed BMP file. And after some reading, copying and checking with a hex editor...it kinda works. Now I'm just wondering what's making this output. Is it because of my RGB conversion? or my horrible attempt at hacking the Hex format. Even so, why it the bloody hell is it slanted... Too much of something on each row? Anyways, the code is VERY hack and slash and fit to none of my standards other than "it works." Though this is only because Strings don't support ASCII values of 0 and 128.
PS: Turing help is a massive pain with uploading, previewing and all with this template. |
Author: | Dan [ Sun Aug 02, 2009 6:43 am ] | ||
Post subject: | RE:Screen -> File using Hex Output | ||
If what you mean is save the screen to a bmp file turing can allready do this:
|
Author: | Brightguy [ Sun Aug 02, 2009 11:28 am ] |
Post subject: | Re: Screen -> File using Hex Output |
You're drawing an image of width 101 into a bitmap of width 100. Also your alignment is off, you don't need any row padding for width 100. |
Author: | Zren [ Sun Aug 02, 2009 11:53 am ] | ||||
Post subject: | Re: RE:Screen -> File using Hex Output | ||||
Dan @ Sun Aug 02, 2009 6:43 am wrote: If what you mean is save the screen to a bmp file turing can allready do this:
Oh that's cool. I started looking through the module and found Pic.ScreenSave( x1, y1, x2, y2, filename ) and skips the first line and the extra Pic.Free() at the end. I took out the end of line statement and it still works (got rid of that ugly diagonal line dabut). Then I remembered I started the two for loops from 0 thus making 0..100 101 pixels in dimension. Thus causing the overflow onto the next row of pixels. (Hey I first coded this past midnight). I could go further with this and make it into a module and such but seeing as the code has already been made, this'll do. EDIT: Thanks brightguy. You musta posted right after I click reply. End Results:
|