HighTechTalks DotNet Forums  

rectangle paints as transparent when white or nearly white (vb.net - .NET 1.1)

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss rectangle paints as transparent when white or nearly white (vb.net - .NET 1.1) in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Wayne Erfling
 
Posts: n/a

Default 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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.