Click here to Skip to main content
11,922,877 members (48,083 online)
Rate this:
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 6:01am

1 solution

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

Solution 1

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151125.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