Is TextRenderer.DrawText() capable to draw the end of a text when destination rectangle is too small?
TextFormatFlags.Bottom didn’t helped me.
In others words: how to clip text on its top edge?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create an in memory bitmap that is the size of the “overflow area”. Draw your text string to this overflow area with a -Y coord that so that it draws off the top of the image that lines up with the area you want to clip to. You now have the overflow text in an image that you can paint where you want it.
For example, if you want to draw text that is 100 pixel high in an area that can only show 75 pixels, create a 25 pixel high image, and draw your text to that image at y=-75.