rectangle paints as transparent when white or nearly white (vb.net - .NET 1.1) -
12-26-2006
, 03:14 PM
We have a vb.net object that creates a bitmap and eventually renders it to an .EMF file; then it is viewed via Internet Explorer. The second rectangle renders as transparent if the color is from RGB 253,253,253 through Color.White. From 252,252,252 on "down" paints as coded.
We want this rectangle to paint as coded, including when it is set to white.
The first steps in creating the graphic are to write a border rectangle and then a fill rectangle just inside that border rectangle:
'Create brushes
Dim ObjBrush As New SolidBrush(clrBorderColor)
Dim objBrush2 As New SolidBrush(clrFillColor)
'Create a rectangle to set the boundaries to the bitmap boundaries
Dim objRect As Rectangle = New Rectangle(0, 0, intLength, intHeight)
Dim objRect2 As Rectangle = New Rectangle(intBorderThickness, intBorderThickness, intLength - 2 * intBorderThickness, intHeight - 2 *
intBorderThickness)
'Add a rectangle to the image
objGraphics.FillRectangle(ObjBrush, objRect)
objGraphics.FillRectangle(objBrush2, objRect2) ' this paints as transparent if the color is too close to white.
We also tried calling bitmap.MakeTransparent(Color.LimeGreen), but this had no effect.
Basically, no part of this bitmap / EMF file should be transparent.
Any help appreciated on painting WHITE to a bitmap.
---Wayne Erfling |