Mikecrosoft
01-23-2004, 02:38 PM
Hi all,
I'm so happy, I soon to finish my first GUI Window, I did it completly in .NET, but I'm using Transparencies instead of Regions, I want some transparencies but also I need to remove regions (red part of the upper left corner of the window image posted), ok I'm using my own Regions maker function
[VB]
Public Function MakeRegion(ByVal bmpMask As Bitmap, ByVal clrMask As Color) As Region
Dim GpP As New Drawing2D.GraphicsPath
Dim Pix As Color
Dim y, x As Integer
For y = 0 To bmpMask.Height - 1
For x = 0 To bmpMask.Width - 1
Pix = bmpMask.GetPixel(x, y)
'Comparar solo los componentes RGB de los colores
If Pix.R <> clrMask.R And Pix.G <> clrMask.G And Pix.B <> clrMask.B Then
GpP.AddRectangle(New Rectangle(x, y, 1, 1))
End If
Next x
Next y
Return New Region(GpP)
End Function
[VB]
But If I used this function sleeps my PC every time I resized the Window, How I can do a better function ??
Thanks
Mike
I'm so happy, I soon to finish my first GUI Window, I did it completly in .NET, but I'm using Transparencies instead of Regions, I want some transparencies but also I need to remove regions (red part of the upper left corner of the window image posted), ok I'm using my own Regions maker function
[VB]
Public Function MakeRegion(ByVal bmpMask As Bitmap, ByVal clrMask As Color) As Region
Dim GpP As New Drawing2D.GraphicsPath
Dim Pix As Color
Dim y, x As Integer
For y = 0 To bmpMask.Height - 1
For x = 0 To bmpMask.Width - 1
Pix = bmpMask.GetPixel(x, y)
'Comparar solo los componentes RGB de los colores
If Pix.R <> clrMask.R And Pix.G <> clrMask.G And Pix.B <> clrMask.B Then
GpP.AddRectangle(New Rectangle(x, y, 1, 1))
End If
Next x
Next y
Return New Region(GpP)
End Function
[VB]
But If I used this function sleeps my PC every time I resized the Window, How I can do a better function ??
Thanks
Mike