Light and slow crappy image scaling
- Posted by Mike The Spike <mikethespike2000 at HOTMAIL.COM> Apr 16, 2000
- 420 views
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