Click here to Skip to main content
15,914,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I'm trying to change the color of pixels for my form but nothing changed.
VB
       private sub mybtn_click()  
       Dim MyPixel As System.Drawing.Bitmap
       Dim myColor As System.Drawing.Color
        myColor = System.Drawing.Color.FromArgb(0, 0, 0)
        MyPixel = New Bitmap(Me.Width, Me.Height)
        For i As Integer = 0 To 100
            For j As Integer = 0 To 100
                MyPixel.SetPixel(i, j, myColor)
                
            Next j
        Next 
end sub

after run when i click on my btn my pixels color changed but i can't see the new color. why?
Posted

Well, you set the pixels' colour, but you nowhere paint your new bitmap onto your form.
 
Share this answer
 
So how can I paint it? I must repaint my form?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900