Article ID: 312119 - Last Review: December 3, 2007 - Revision: 4.7 Save method of Bitmap class does not truncate file size
This article was previously published under Q312119 Note Microsoft Visual C++ .NET (2002) supports both the managed code
model that is provided by the Microsoft .NET Framework and the unmanaged native
Microsoft Windows code model. The information in this article applies only to
unmanaged Visual C++ code. Note Microsoft Visual C++ 2005 supports both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. The following .NET Framework Class Library namespaces are
referenced in this article:
On This PageSYMPTOMS When you invoke the Save method of the Bitmap class to overwrite an existing file of the same name, the
resulting file is not truncated as expected. CAUSE This behavior occurs because the implementation of the Save method does not truncate any already existing file.
RESOLUTION To work around this issue, delete the file before you
invoke the Bitmap.Save method. The file can be deleted in Visual Basic .NET or in Visual Basic 2005 and C# by using the System.IO.File.Delete method provided by the .NET Framework in the System.IO namespace. MORE INFORMATIONSteps to reproduce the problem
APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
