Page 2 of 2

Re: Software Question

Posted: Wed Mar 05, 2014 6:24 pm
by dilwyn
tofro wrote:Something along the lines of this would probably work, I guess (untested, will also only work for screen areas that are byte-aligned )
Tobias
Nice work! Could form the basis of a graphics cut/copy/paste type routine.

It might be worth giving it the full _pic file header 10 bytes, that way a simple SBYTES 'filename',address,mneed command could save the 'window' area cut or copied to file as a standard PE _pic file too:

Code: Select all

210   mneed = blen * y + 10 : Rem memory needed, +10 bytes for pic header
220   address = ALLOCATION(mneed)
225   poke_w address,hex('4AFC')
230   poke_w (address+2, w) : poke_w (address + 4, h) : Rem remember width and height
235   poke_w  address+6,blen
236   poke  address+8,mode_number
237   poke  address+9,0 : REM spare byte
240   dstPtr = address + 8 : srcPtr = bstart
PIC file header format is:
Word - $4AFC (19196 in decimal)
Word - width in pixels
Word - height in pixels
Word - line increment in bytes
Byte - mode number
Byte - spare (usually 0, used for something only by QDesign IIRC)

(goes into hiding before tofro objects to being given more work to do :mrgreen: )

Re: Software Question

Posted: Wed Mar 05, 2014 6:51 pm
by tofro
dilwyn wrote: (goes into hiding before tofro objects to being given more work to do :mrgreen: )
Tofro considers his job (concept development) done ;)

The minor details are left as an exercise to the reader :D

Re: Software Question

Posted: Wed Mar 05, 2014 6:52 pm
by dilwyn
tofro wrote:
dilwyn wrote: (goes into hiding before tofro objects to being given more work to do :mrgreen: )
Tofro considers his job (concept development) done ;)

The minor details are left as an exercise for the reader :D
Drat. And double drat. :cry:

Re: Software Question

Posted: Wed Mar 05, 2014 7:26 pm
by tofro
Added service: Fix the obvious bug:

instead of

Code: Select all

190   blen = int ((w + 7) / 8) : rem length of one window scanline in bytes, rounded up
it should be

Code: Select all

190   blen = int (w*bpp) : rem length of one window scanline in bytes, rounded up
other errors are left as further exercise to the reader ;) (I did mention it was untested, didn't I?)


Tobias

Re: Software Question

Posted: Thu Mar 06, 2014 1:29 pm
by Mr_Navigator
Many thanks QLer's, much to try, I will get back to this once done. :)