Hi guys,
I'm working on a night scene for my GDI game and I face some serious problems with the 'Graphics.SetClip' function. I use SetClip to make transparent regions where the spot lights will move, unfortunately when I intersect the two 'clip' regions they didn't merge, instead they make something like 'And' representation of each other:
http://dustwallow.webs.com/clip.png[
^]
I played around with the 'CombineMode' property, but it didn't fix the problem. Here's the code of my 'Clipping' method:
Public Sub SetClipRegion(e As PaintEventArgs, intX As Integer, intY As Integer, intrW As Integer, intH As Integer)
Dim clipPath As New GraphicsPath()
clipPath.AddEllipse(intX, intY, intrW, intH)
clipPath.AddEllipse(intX + 100, intY + 100, intrW, intH)
e.Graphics.SetClip(clipPath, CombineMode.Replace)
e.Graphics.FillRectangle(New SolidBrush(Color.Black), intX, intY, intrW, intH)
End Sub
Please help. :(