There’s nothing magical about the operation as such. A rectangular image is interpolated to fit onto a non rectangular area, pixel by pixel. Bilinear means, that it does linear interpolation on both axises.
OpenGL will do it for you, and much much faster.
I don’'t have anything handy, but you should be able to find something on flipcode or gamedev.net.
But basically, you view the image file as a lookup table and use an a algo similar to a regular line drawing thing, that picks it’s colour from the image on a percentage basis.