Re: Light and slow crappy image scaling

new topic     » goto parent     » 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.

Huh?
I just used the line routine above to create a "scale_bitmap" routine, then
I did a loop with Jiri's "scale_image" routine and my routine stretching the
same bitmap every iteration yet drawing them below eachother, and they both
draw it at the same pixel-precise speed!
Eighter it's a timing thing in ex.exe, or both routines are 100% equaly
fast!

Can I just attach the program to my mail?
Or won't that work?

Mike The Spike

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu