Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
Questionhandles Pin
NasimKaziS6-Aug-06 18:23
NasimKaziS6-Aug-06 18:23 
AnswerRe: handles Pin
Ed.Poore6-Aug-06 22:20
Ed.Poore6-Aug-06 22:20 
Questionhow to retrieve a bit Pin
sarojkumarjena6-Aug-06 17:46
sarojkumarjena6-Aug-06 17:46 
AnswerRe: how to retrieve a bit Pin
stancrm6-Aug-06 20:03
stancrm6-Aug-06 20:03 
GeneralRe: how to retrieve a bit Pin
sarojkumarjena6-Aug-06 20:40
sarojkumarjena6-Aug-06 20:40 
GeneralRe: how to retrieve a bit Pin
stancrm6-Aug-06 20:58
stancrm6-Aug-06 20:58 
GeneralRe: how to retrieve a bit Pin
Divyang Mithaiwala7-Aug-06 2:46
Divyang Mithaiwala7-Aug-06 2:46 
Questiondifference between point and pointF Pin
KrunalC6-Aug-06 16:44
KrunalC6-Aug-06 16:44 
I wanted to draw the lines with higher precision for one of my project. So instead of using point structure, I thought to make a use of pointF strucuture. I made one sample application to test how precision differs in case I use pointF strucutre then point. Following is the sample code which i written to draw a lines on my form :


protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
e.Graphics.DrawLine(new Pen(System.Drawing.Color.Red),new PointF(20.0F, 100.0F), new PointF(100.0F, 100.0F));
e.Graphics.DrawLine(new Pen(System.Drawing.Color.Green),new PointF(20.0F, 100.51F), new PointF(40.0F, 100.51F));
}

As per above code, I tried to draw 2 lines with very minimal difference in y co ordinates. I was shocked to find out that pointF rounds the co ordinate value while drawing the line. As per above example, if I keep Y co ordinates for 2nd line between 100.00 to 100.50, I can see only one line drawn as lines are drawn with the same co ordinates. But if I keep the Y co ordinates for 2nd line even 100.51 then I can see two seperates lines. This means pointF strucutre rounded the y co ordinate value to 101 and that is why i could see two different line. I tried to check the things by increasing and decreasing the resolution of my screen but it didn't help. If such is the behaviour then there is no difference between the point and pointf and we can not get the better precision then 1 pixel while plotting a drawing.
Can any one pls explain me above behaviour? I want to draw the lines with higher resolution so can anyone give me the idea of how to achieve it? I hope I'm clear with my question and expectation?
AnswerRe: difference between point and pointF Pin
Rob Graham6-Aug-06 16:55
Rob Graham6-Aug-06 16:55 
GeneralRe: difference between point and pointF Pin
KrunalC6-Aug-06 17:20
KrunalC6-Aug-06 17:20 
AnswerRe: difference between point and pointF Pin
Guffa6-Aug-06 21:29
Guffa6-Aug-06 21:29 
GeneralRe: difference between point and pointF Pin
KrunalC6-Aug-06 23:27
KrunalC6-Aug-06 23:27 
GeneralRe: difference between point and pointF Pin
Guffa6-Aug-06 23:31
Guffa6-Aug-06 23:31 
QuestionQuestion about DateTime or any other Data\Time object ... Pin
Yanshof6-Aug-06 13:10
Yanshof6-Aug-06 13:10 
AnswerRe: Question about DateTime or any other Data\Time object ... Pin
Shy Agam6-Aug-06 13:23
Shy Agam6-Aug-06 13:23 
GeneralRe: Question about DateTime or any other Data\Time object ... Pin
Yanshof6-Aug-06 13:31
Yanshof6-Aug-06 13:31 
AnswerRe: Question about DateTime or any other Data\Time object ... Pin
Ravi Bhavnani6-Aug-06 14:03
professionalRavi Bhavnani6-Aug-06 14:03 
QuestionHow do we pass along arguments to another thread while preventing multiple instances? Pin
Mikzi6-Aug-06 13:03
Mikzi6-Aug-06 13:03 
AnswerRe: How do we pass along arguments to another thread while preventing multiple instances? Pin
Judah Gabriel Himango6-Aug-06 17:52
sponsorJudah Gabriel Himango6-Aug-06 17:52 
GeneralRe: How do we pass along arguments to another thread while preventing multiple instances? [modified] Pin
Mikzi7-Aug-06 0:26
Mikzi7-Aug-06 0:26 
GeneralRe: How do we pass along arguments to another thread while preventing multiple instances? Pin
mav.northwind7-Aug-06 3:21
mav.northwind7-Aug-06 3:21 
AnswerRe: How do we pass along arguments to another thread while preventing multiple instances? Pin
Mikzi7-Aug-06 12:09
Mikzi7-Aug-06 12:09 
QuestionBarcode Pin
omar el halwagy6-Aug-06 12:50
omar el halwagy6-Aug-06 12:50 
AnswerRe: Barcode Pin
Judah Gabriel Himango6-Aug-06 13:02
sponsorJudah Gabriel Himango6-Aug-06 13:02 
QuestionAuto refresh of referenced library... Pin
Shy Agam6-Aug-06 11:27
Shy Agam6-Aug-06 11:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.