Hi all
I need to write some strings on a Graphic surface of a simple control with a
color that is not blend with background color.
To get this, I simply need set CompositingMode to SourceCopy.
This is the code:
Dim aGraphicSurface As Graphics = CType(mObject,
Control).Parent.CreateGraphics
aGraphicSurface.CompositingMode = CompositingMode.SourceCopy
aGraphicSurface.DrawString(mCaptionText, mCaptionFont, _
New SolidBrush(mCaptionColor), _
mTextRectangle, _
mStringFormat)
The above code reises me an ArgumentException (invalid parameter) error.
I cannot understand why the error is raised.
Some additional notes:
DrawImage works correctly.
Removing aGraphicSurface.CompositingMode = CompositingMode.SourceCopy
everything works correctly.
I also tried to set different Alpha levels of mCaptionColor.
I also tried to change other Graphics setings (such as CompositionQuality,
InterpolationMode, SmoothingMode, TextRenderingHint, ecc.), without results.
Could you please help me?
Thank yuu,
Carlo
-------------------------------------------
Carlo, MCP (Windows Based Applications)
ca************@gmail.com