Light and slow crappy image scaling

new topic     » topic index » view thread      » older message » newer message

I just wrote a routine to scale a titlebar (640*22) in the x dimension, ie.
to make it stretch to the left and right, but not in the height. The routine
can only scale one line at a time. I think it's slow, but I could be
wrong...
Here it is, you laugh and you die! (j/k)


object newline,ix

global function shrink_line(sequence line,integer l)
newline = repeat(0,l)
ix = 1
for i = 1 to length(line) by length(line)/l do
    newline[ix] = line[i]
    ix = ix + 1
end for
return newline
end function

Mike The Spike
PS. 'line' is a sequence of color index values into the palette (ie.
read_bitmap()[2][1]), and 'l' is the new length to give the line (ie. scale
it)
And, this comes from a Euphoria program, Interpretted that is.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu