Software Question

Anything QL Software or Programming Related.
User avatar
dilwyn
Mr QL
Posts: 3090
Joined: Wed Dec 01, 2010 10:39 pm

Re: Software Question

Post 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: )


User avatar
tofro
Font of All Knowledge
Posts: 3112
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Software Question

Post 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


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
dilwyn
Mr QL
Posts: 3090
Joined: Wed Dec 01, 2010 10:39 pm

Re: Software Question

Post 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:


User avatar
tofro
Font of All Knowledge
Posts: 3112
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Software Question

Post 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


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Re: Software Question

Post by Mr_Navigator »

Many thanks QLer's, much to try, I will get back to this once done. :)


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
Post Reply