Start here:
Why do I get a "Parameter is not valid." exception when I read an image from my database?[
^] and check exactly what it does. Then check your save code, and the DB content.
If that all looks good, use the debugger to look at exactly what is happening in your method - you use of
using
there is ... um ... different and is likely to cause other problems later, since it will force a Dispose on the Image that both
imageFormat
and
img
(and by extension the outside world that calls this method) are referring to.
using
blocks should be used for new instances, not existing ones.