Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have code like this

C#
foreach (Point p in clusters[i])
{                  
    //this is my code
}


p is coordinates of image
like (4, 100) where x=4 and y=100

what should code add
so that each coordinate p, changed the pixel value
Posted

1 solution

Use Bitmap.SetPixel:
C#
myBitmapToChange.SetPixel(p.X, p.Y, Color.Green);
 
Share this answer
 
Comments
gunkrr 20-Apr-13 11:35am    
i am try to use this code
but i have an error

Bitmap region is already locked.

can you help me
OriginalGriff 20-Apr-13 11:38am    
Without seeing your existing code? Nope! :laugh:
What is locking your bitmap? Do you have any other code using it at the time?
Do you call Bitmap.LockBits anywhere?
gunkrr 20-Apr-13 23:19pm    
yes i do that
missed to seeing :lol

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