Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hello Every1,
 
I do study on image processesing lately. I need some information to improve myself.
So far, I have made processes which applies entire picture.
But now I want to process the image where I click. So I kind of need to create brushes, use them. I have no idea how to do this.
 
1.) I wonder if anyone can lead me some websites or references that I can read and learn how to achieve creating brushes and using them on image in c#.
 
Apart from this, I ve been looking for finding the actual coordinates of the pixel I click on. I found a piece of code that I get the coordinates of picturebox. But it's not the actual image most of the time ( for example, when the picture is streched or zoomed or something)
2.) How can I get the actual image coordinates by clicking on it?
 
Thanks already...
Posted 30-Nov-09 4:58am
XMLB164
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

What sort of brushes do you want to create ? I wrote a GDI+ article ages ago ( although it may be in c++ ) covering the different types of brushes.
 

wrote:
2.) How can I get the actual image coordinates by clicking on it?

 
Your best bet is to draw your own image in your paint event, so that you are responsible for any resizing that occurs, and can therefore reverse that algorithm to convert a point in the image on screen to that point in the actual image.
 
Pictureboxes are not really compatible with image processing.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I want to create some circual brushes. I ve got some filters I ve written. I want to apply this filters not entire picture, but the point I click and and inside this brushes...
So I'm kind of stuck now Smile | :)
 
About drawing my own image... what do you mean? Where else can I draw my image apart from picturebox? I'm still pretty new in programming. Would appreciate a lot if you helped a bit more, too Smile | :)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

The best way to do that, IMO, is to create the brush as a bitmap, with a section around the circle drawn in a color not used inside the brush. Then you can use an ImageAttributes class to specify a range of colors to draw transparently, in order to draw only the circle.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 215
1 George Jonsson 175
2 Kornfeld Eliyahu Peter 159
3 PIEBALDconsult 110
4 Richard MacCutchan 85
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 30 Nov 2009
Copyright © CodeProject, 1999-2014
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