#include ONCE "window9.bi"

sub Save_Image(pImage as Hbitmap, sPath as string) export
	
	dim as string sExtension = lcase(GetExtensionPart(sPath))
	
	if sExtension = "jpg" then sExtension = "jpeg"
	
	dim as Gerror ptr err_
	
	gdk_pixbuf_save(pImage, strptr(sPath), strptr(sExtension), @err_, NULL)

End Sub