Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GDI and GDI+ difference

Status
Not open for further replies.

andrey

Programmer
Jun 23, 2000
24
IL
Is there any way in VB.NET to draw rounded rectangles and invert images?
 
Hi andrey. Probably not the best way to do it - but here is one way.

Code:
Private Sub InvertBitmap(g As Graphics, b as Bitmap)

    Dim x, y, red, green, blue As Int32

    For x = 0 To b.Width - 1
        For y = 0 To b.Height - 1
            red = 255 - b.GetPixel(x, y).R
            green = 255 - b.GetPixel(x, y).G
            blue = 255 - b.GetPixel(x, y).B
            b.SetPixel(i, j, Color.FromArgb(red, green, blue))
        Next
    Next

End Sub

T0AD

There's a thin line between genius, and insanity!
 
Thank you very much, but I prefer to use old good InvertRect or InvertRgn.
Truly - there's a thin line between genius, and insanity!
There are so many features for each trifle in NET...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top