473,382 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Draw string to region

Hi,

I'm wanting to draw a string to a region using the GDI+ classes. I currently have the text draw and then clipped however the text always 'seeps' out the edges of the shape:



As you can see the text is not wrapped properly in the circle and parts of the words are off the screen. I want the text to be able to wrap itself into the bounds of the shape without anything leaking out of the edges, unless it runs out of space.

Thanks in advances,
Josh
Feb 2 '13 #1
2 1253
zmbd
5,501 Expert Mod 4TB
OP: Please be aware that most images linked to from outside sources may not be available to everyone. Indeed, if I had been at work instead of at the home PC today, I wouldn't have been able to see the image.

Next:
You have provided NOTHING in the way of what you've already done. Bytes is not a code nor homework service. Please read the FAQ and posting guidelines.

Basically, please show your work.
Feb 2 '13 #2
There's not really much code to show really. I'm using something like this:
Expand|Select|Wrap|Line Numbers
  1. g.DrawString("long text here", f, blueBrush, x, y, rectangle)
  2.  
That wraps the text to the rectangle but if the shape is anything else, like a cirlcle, the text runs out the edges. (Like on the image in the OP)
Feb 2 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: sector119 | last post by:
How am I able to draw a sting with some angle on image?
11
by: Altramagnus | last post by:
I have a complicated Region object, which I need to draw the outline, but not fill How can I convert the Region object to GraphicsPath object? or How can I draw the outline of the Region object?
4
by: Mathieu Chavoutier | last post by:
Hi. I would like to do something like paint. I try to draw a line. I want, like paint, that when I clickdown, it begins to draw the line, and then, when I move the mouse, the line follow the...
0
by: melanieab | last post by:
Hi, I'm trying to get a clock to run. What I have is this: private void toggleOnOff_Click(object sender, System.EventArgs e){} which looks to see which picture to load in a picturebox. It...
5
by: Martin Wolff | last post by:
Hi !! To draw multiple graphics objects which have different shapes, I’m using the region class to exclude/union the drawing area of these Objects. The rectangle around a single object is of...
1
by: Cc | last post by:
how do I draw string upside down?
7
by: Mark Ingram | last post by:
Hi, how can i draw a rounded rectange, with a border within a specified area? i.e. if i have a Rectangle with width and height of 100, how can i draw a rectange with 2 pixel border inside of the...
1
by: Jeff Waskiewicz | last post by:
Hello All, I'm trying to solve a nagging problem. The goal is to draw a rectangle over the top of all the other controls on a form. Specifically, over a ChartFX control. The user would draw...
0
by: Jon Slaughter | last post by:
In my code I'm trying to draw a generic button with an arbitrary clipping region. Is there any way I can get the outline of the region to draw its border? Basically what I'm trying to do is...
0
by: dongarbage | last post by:
Hi there, I have a panel that I'm trying to draw lines on based on mouse events. I'm using a Graphics object to do this. However, the region that the graphics object will draw lines in is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.