Click here to Skip to main content
11,571,155 members (67,388 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
gunkrr647

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


Advertise | Privacy | Mobile
Web03 | 2.8.150624.2 | 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