GLBasic forum

Codesnippets => 2D-snippets => Topic started by: Kitty Hello on 2019-Aug-07

Title: ReSampler - high quality image scaling
Post by: Kitty Hello on 2019-Aug-07
The following is a C++ wrapper for a library, that does high-quality image scaling.
To use it, just add the gbas file to your project. The C++ lib is linked by REQUIRE.

Here's how to use it as a STRETCHSPRITE substitute:
Code: GLBasic [Select]
FUNCTION HQStretchSprite: id%, x%, y%, w%, h%
LOCAL s2% = GENSPRITE()
        ReSampler(id, s2, w,h)
        DRAWSPRITE s2, x,y
        GRABSPRITE s2, 0,0,0,0
ENDFUNCTION
 
Warning - the above does not work (yet), if you're currently on an offscreen (USESCREEN x).
Title: Re: ReSampler - high quality image scaling
Post by: Snoopy on 2019-Aug-07
It's cool and very useful, thanks Gernot :good: