Hi Anatoliy
>I have found that RENAME command in the code above changes file security attributes, which makes the .Net Bitmap constructor fail.
>
>So I have switched to another code solving this issue. The code replaces the image's content without changing its security attributes:
>
>hFile = FOPEN(originalimage, 1)
>= FCHSIZE(hFile, 0)
>= FWRITE(hFile, FILETOSTR(optimizedimage))
>= FCLOSE(hFile)
>
Very nice solution!