BUG: A bitmap does not render the Antialiased property, the Transparency property, and the Color property in the .NET Framework (867631)
The information in this article applies to:
- Microsoft .NET Framework 1.1
- Microsoft .NET Framework 1.0
SYMPTOMSThe Antialiased property, the Transparency property, and the Color property are not
reflected in a bitmap when you try to draw an image by using the Render.Draw() method.
The image appears only as a black color in the bitmap field. However, the Transparency property and the Color property are reflected when rendered directly to the
Graphics object of a control.CAUSEWhen you try to render the Antialiased property, the Transparency property, and the Color property to a bitmap, you use Graphics Device Interface (GDI) on a GDI+
graphics object to do this. The Graphics::GetHDC() method is called for the
Graphics object that is backed by a bitmap instead of by a screen.
When the Graphics::GetHDC() method is called, a memory HDC
internal method is created, and then a new HBITMAP handle object is created and is put in the memory HDC internal method. This
new memory bitmap is not initialized with the original image of the bitmap. This
new memory bitmap is initialized with
a sentinel pattern that enables GDI+ graphics object to track changes to the new memory bitmap. Any
changes that are made to the new memory bitmap by using the GDI code become
noticeable in the changes to the sentinel pattern. When the Graphics::ReleaseHDC() method is
called, those changes are copied back to the original bitmap. Because the
new memory bitmap is not initialized with the image of the original bitmap, an HDC internal method that is
obtained in this way is considered "write only." Therefore the HDC internal method is not
suitable for use with Raster Operations (ROPs) that require the
ability to read the target. For example, the HDC internal method is not suitable for use with the R2_XOR Raster Operation.
Also, there is a performance cost to
this approach. The GDI+ graphics object has to copy the changes back to the original bitmap.STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.REFERENCESFor additional information about about Tablet PC pen and ink, visit the following Microsoft
Developer Network (MSDN) Web site: For additional information about printing ink, visit the following MSDN Web site:
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
311221
Interoperability between GDI and GDI+
Modification Type: | Major | Last Reviewed: | 7/8/2004 |
---|
Keywords: | kbgraphic kbGDIPlus kbView kbtshoot kbbug KB867631 kbAudDeveloper |
---|
|