Re: How to Drawstring with a character drawn "partially"?

From: kjon (2_at_22.co)
Date: 06/08/04


Date: Tue, 8 Jun 2004 13:11:45 +0800

Thanks Bob. Your sites have been very helpful.

Regarding drawing text character partially, I'm not too sure how to use the
method you suggest? It would be nice if you could give me some example on
how to calculate the position of the text, or using a clipping region?
Thanks.

"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:%23$8dfG8SEHA.3332@tk2msftngp13.phx.gbl...
> You could draw the text without setting a layout rectangle, perhaps just
> calculate the start position of the text.
>
> To clip the text to a specific rectangle use the rectangle to create a
> clipping region on the graphics object.
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Image transition effects, snap-to-grid and Layered Windows are
> all discussed in May's edition of Well Formed for C# or VB programmers
> http://www.bobpowell.net/currentissue.htm
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/gdiplus_faq.htm
>
> The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
> Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
> Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
>
>
>
>
>
>
> "kjon" <y@y.co> wrote in message
> news:%23WwTNBsSEHA.1308@TK2MSFTNGP10.phx.gbl...
> > Hi, I'm trying to use Drawstring to draw a text which can let the
> rightmost
> > character of the text only shown partially.
> >
> > Have tried on DrawString(String, Font, Brush, RectangleF), which I can
> size
> > the rectangle with the text that fit into the rectangle will only be
> drawn.
> >
> > But I find that if a character cannot fit into the rectangle, the whole
> > character will not be drawn unless the size of the rectange increase,
the
> > character just cannot be drawn partially according to the rectangle
size.
> >
> > Is it possible to do this with drawstring? Or is there any other methods
> > should I use to achieve this effect? Please advice. Thanks in advance.
> >
> >
>
>



Relevant Pages

  • Re: Drawing text without an offset
    ... Graphics.MeasureString to find the size of the rectangle that the first part ... Rectangle added to the X and Y properties of the ClipRectangle to define ... I then measure the character range for the last character. ... The region is correct as when I fill the region and draw the whole string ...
    (microsoft.public.dotnet.languages.csharp)
  • How to Drawstring with a character drawn "partially"?
    ... I'm trying to use Drawstring to draw a text which can let the rightmost ... the rectangle with the text that fit into the rectangle will only be drawn. ... But I find that if a character cannot fit into the rectangle, ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Replacing a "rectangle" character in a list
    ... such a character is Word's "I can't ... to change the bullet character for selected text. ... some lists with "bullets" that look like an open rectangle that's ... If I try to "unbullet" the list or change the bullet via the Format ...
    (microsoft.public.word.newusers)
  • Re: How to Drawstring with a character drawn "partially"?
    ... Use the stringformat class and set stringtrimming to none. ... Create interactive diagrams and flowcharts with ERM Diagram at ... > character of the text only shown partially. ... > the rectangle with the text that fit into the rectangle will only be ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: How to Drawstring with a character drawn "partially"?
    ... You could draw the text without setting a layout rectangle, ... > character of the text only shown partially. ... > character will not be drawn unless the size of the rectange increase, ...
    (microsoft.public.dotnet.framework.drawing)