473,765 Members | 2,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Draw string to region

28 New Member
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 1263
zmbd
5,501 Recognized Expert Moderator Expert
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
Josh Argent
28 New Member
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
1110
by: sector119 | last post by:
How am I able to draw a sting with some angle on image?
11
7651
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
734
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 cursor. I have tried many things, and I have mysterious things appening. Here, I can't remove the lines I have drawed : http://img26.exs.cx/img26/4302/GRRRRRRRRRRRR.png
0
1125
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 then says to either go to this.notPolar(); or this.Polar(); of which I have:
5
1766
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 the size of 80x80 pixels. So looping through these pixels and excluding the area of every transparent pixel, the region will be built. Afterwards, such an object has a memory usage of approx. 700Kb (before
1
2572
by: Cc | last post by:
how do I draw string upside down?
7
10692
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 original one? (the current attempts all draw the border just outside of the original rectangle). At the moment im using the following code, but it allows the rectangle to grow - which i definately dont want!
1
3776
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 the rectangle using the right mouse button to represent the area of the chart they want to zoom on. I haev been able to draw the rectangle on a blank form but I cannot get it to draw on top of other controls. I have pasted in the code i am using ....
0
2110
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 take the region of a control and first draw the border using one color then shrink it down a pixel or two and draw it again using another color and shrink it down again and fill the interior. It seems that if I can't get the outline of the region...
0
1339
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 different in size than the panel size. I'd like the graphics object's clipping region (is "clipping region" the right terminology?) to be the same size as the panel. How do I do this? Note that the default size of the clipping region for the graphics
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5277
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.