C# Replacing a transparent background with White

Hi,
I am trying to read an image file (which might be PNG, JPG,, or GIF) and, if it has a transparent background change the background to White, then resize it and writing it out as a GIF file while maintaining the highest quality possible.
I know the code below isn't quite right, I've tried various iterations but been unable to get the background color to change. Any help/suggestions appreciated.
Thanks