MeasureString is not accurate and it doesn't do exactly what I want.
I have seen MeasureString returning widths less than what was drawn!
Anyway, I need to know the exact number of pixels wide the text was
drawn. The scanning method seems like the only solution for me at the
moment.
-
TM
"Alex Yakhnin, MVP" <(E-Mail Removed)> wrote in message news:<Ors$#(E-Mail Removed)>...
> Why's MeasureString no good for you?
> Keep in mind, that GetPixel call is very slow on CF.
>
> --
> Alex Yakhnin, NET CF MVP
> IntelliProg, Inc.
> http://www.intelliprog.com
>
> "Two Many" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Use MeasureString, right? Nope, I need to find out the exact width of
> > drawn text. I am thinking of inspecting pixels to find where the text
> > starts and ends. I would start to scan vertically from the far left
> > and move right until I hit a colored pixel and this would be the
> > start. Then, I would scan vertically from the far right and move left
> > until I hit a colored pixel and this would be the end. Thus,
> > end-start = exact drawn width. This is the best that I could think
> > of... unless somebody has a better solution????
> >
> > -
> > TM