473,395 Members | 1,756 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,395 software developers and data experts.

GraphicsPath.AddString Problem!

jay
Hi!

I'm using this code to add text to the GraphicsPath m_Gpath:

m_Gpath.AddString(m_objectLabel, otherFont.FontFamily,
(int)otherFont.Style, (int)otherFont.Size, new Point(m_MouseX,
m_MouseY), StringFormat.GenericDefault);
I'm using this code to paint Bitmap m_Bitmap on a picture control:

private void picSketch_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawImage(m_Bitmap, new Rectangle(0, 0,
(int)(m_Bitmap.Width*Zoom), (int)(m_Bitmap.Height * Zoom)));

e.Graphics.FillPath(new SolidBrush(skyobjFontColor) ,
m_Gpath);

}
I'm using this to save bitmap:

m_Bitmap.Save(saveFileDialog.FileName, ext);
Now, I get the text (crisp, not smooth) in picture box, but saving the
m_Bitmap does not save text with it!

adding this does not help either:

e.Graphics.DrawPath(new Pen(Color.Red), m_Gpath);

Changing the order in picSketch_Paint doesn't help neither:

private void picSketch_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.FillPath(new SolidBrush(skyobjFontColor) ,
m_Gpath);
e.Graphics.DrawPath(new Pen(Color.Red), m_Gpath);

Graphics g = e.Graphics;

g.DrawImage(m_Bitmap, new Rectangle(0, 0,
(int)(m_Bitmap.Width*Zoom), (int)(m_Bitmap.Height * Zoom)));
}

Can someone with an experience with this sort of thing help me please?
I suppose there should be a way to "glue" graphics path to bitmap but
I don't know how.

thanks all,
jay
Nov 16 '05 #1
0 2086

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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?
6
by: Altramagnus | last post by:
I have n number of circles. Some of them might overlap. I need to draw the outline of all circles but not those overlap areas. Initially, I am try to use a Region, because a Region object has a...
1
by: jay | last post by:
I have a bitmap and a graphicspath object. I draw pixels on m_Bitmap and I'm drawing text using m_Graphics GraphicsPath object. However, saving my work with m_Bitmap.Save doesn't save...
7
by: Crirus | last post by:
Hi Is that true that this IsVisible method is incredible slow? Seems that my app is much slower with only this added as a condition to draw something Crirus
2
by: Martijn Mulder | last post by:
/* GraphicsPath.IsVisible() gives unexpected results. I fill a System.Drawing.Drawing2D.GraphicsPath-object with PointF-structures that define the unit-square (0,0), (1,0), (1,1) and (0,1). Then I...
2
by: estufa | last post by:
Hi all. I have a problem drawing a string somewhere inside a path using AddString. It looks very large in Y axis and very short in X axis. That's because I have near of 1600 units in X axis and...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.