Click here to Skip to main content
11,637,662 members (91,536 online)
Rate this: bad
good
Please Sign up or sign in to vote.
i have code like this

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 20-Apr-13 5:01am
gunkrr664

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use Bitmap.SetPixel:
            myBitmapToChange.SetPixel(p.X, p.Y, Color.Green);
  Permalink  
Comments
gunkrr at 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 at 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 at 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)

  Print Answers RSS
0 jyo.net 380
1 Sergey Alexandrovich Kryukov 309
2 stibee 308
3 OriginalGriff 230
4 sasanka sekhar panda 190
0 OriginalGriff 9,031
1 Sergey Alexandrovich Kryukov 8,763
2 Mika Wendelius 6,999
3 F-ES Sitecore 2,388
4 Suvendu Shekhar Giri 2,320


Advertise | Privacy | Mobile
Web04 | 2.8.150728.1 | Last Updated 20 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100