473,657 Members | 2,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create EMF with rotated text that is editable in office

Hi Everybody (especially Microsoft),

we build EMF files with rotated text for export to office (powerpoint,
word). It is planned that the text can be edited in the office document.
Without the rotate transformation the text stays as a block and can be
edited in the office document after ungrouping. But a rotated text leads to
single charackters when ungrouping.
The following sample code creates an emf file. The file can be dragged to
powerpoint to see the problem.

Bitmap bmp = new Bitmap(100, 100, PixelFormat.For mat32bppArgb);
Graphics g = Graphics.FromIm age(bmp);
IntPtr hdc = g.GetHdc();
Metafile mf = new Metafile(@"test .emf", hdc);
g.ReleaseHdc(hd c);
g.Dispose();
g = Graphics.FromIm age(mf);
g.RotateTransfo rm(30.0f); // Leads to single charackters in the Emf file
String s = "1.2345";
g.DrawString(s, this.Font, Brushes.Red, 0, 0);
g.Dispose();

Can anyone tell me how I can draw rotated text without loosing the editing
capability?
There must be a way. Because when I make a rotated text area in power point
and save this to an emf picture it can be imported without loosing editing
capability. I already enumerated the metafile to find out the record types.
But that does not tell me which gdi methods I have to use.

Thank you.

Cheers,
Tilo
May 10 '06 #1
2 5782
Try specifying that the metafile can use both EMF and enhanced EMF (with
GDI+ commands).

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Tilo Pätzold" <tilo.paetzold@ R E M O V E l-p-a.com> wrote in message
news:ug******** ******@TK2MSFTN GP03.phx.gbl...
Hi Everybody (especially Microsoft),

we build EMF files with rotated text for export to office (powerpoint,
word). It is planned that the text can be edited in the office document.
Without the rotate transformation the text stays as a block and can be
edited in the office document after ungrouping. But a rotated text leads
to single charackters when ungrouping.
The following sample code creates an emf file. The file can be dragged to
powerpoint to see the problem.

Bitmap bmp = new Bitmap(100, 100, PixelFormat.For mat32bppArgb);
Graphics g = Graphics.FromIm age(bmp);
IntPtr hdc = g.GetHdc();
Metafile mf = new Metafile(@"test .emf", hdc);
g.ReleaseHdc(hd c);
g.Dispose();
g = Graphics.FromIm age(mf);
g.RotateTransfo rm(30.0f); // Leads to single charackters in the Emf
file
String s = "1.2345";
g.DrawString(s, this.Font, Brushes.Red, 0, 0);
g.Dispose();

Can anyone tell me how I can draw rotated text without loosing the editing
capability?
There must be a way. Because when I make a rotated text area in power
point and save this to an emf picture it can be imported without loosing
editing capability. I already enumerated the metafile to find out the
record types. But that does not tell me which gdi methods I have to use.

Thank you.

Cheers,
Tilo

May 10 '06 #2
Good idea. I tried all types.
Both EmfType.EmfOnly and EmfType.EmfPlus Dual result in single
charackter blocks when ungrouping.
EmfType.EmfPlus Only results in an empty graphic when ungrouping.
Unfortunately no type gives a satisfying result.
Our Office version is 2003 SP2.

May 15 '06 #3

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

Similar topics

6
8502
by: rzed | last post by:
I'm using PIL to generate some images which may be rotated at the user's option. When they are rotated, the original image is cropped in the new image (which is fine), and the corners are black (which is not, in this case). I can't find any documented way to change the default fill color (if that's what it is) for the corners, and PIL also doesn't seem to support a flood fill. I have created a flood fill in Python, which works but which...
17
3846
by: black tractor | last post by:
HI there.. l was just wondering, if l place a "table" in the "editable region" of my template, will the text, graphics placed inside the this "table" MOVE BY ITSELF?? l mean, recently l had a "table" insert in my "editable region", have it placed in the "center" of the page.. while it display correctly on my browser, with setting at 1024x768 (IE6),
1
4969
by: amirkargerweb | last post by:
I want to do this: <textarea> perl <font color="FF0000"> $thing_to_get=17; </font> More Perl code using $thing_to_get </textarea>
6
61737
by: charsh | last post by:
Hi, I using the code below to draw a text in a pictureBox1. //Start--------------------------------------------------------------- private void button1_Click(object sender, System.EventArgs e) { Graphics g; g = pictureBox1.CreateGraphics(); g.FillRectangle(Brushes.White,0,0,160,160);
2
1791
by: Gary | last post by:
Hello All, I have an editable data grid in my web form, this grid allows the user to add new records, edit existing records and also delete them. When a user adds a record the grid goes in to edit mode and four text boxes appear, one is for the start date, another for an end date and the other two are for other data, the user fills in the fields and saves the data, all is great at this point, an entry is added ok. However the problem I...
1
7765
by: Eric Apperley | last post by:
How do I draw rotated text in a Tkinter widget using the draw.text method? Alternatively, if I draw text as normal, how can I then subsequently rotate it about its start point?
0
1734
by: Khadim | last post by:
Hi, I am facing a problem in my application. I have an image on which there are many numbers present. I can find the pixel position of the center of those numbers. Now I have the names of those numbers in seperate file which I have to write to corresponding numbers. I rotate my image on 45 degrees with point to rotate 30 pixels on top left which shows my text on 45 degrees on top left. Writing this doesn't gives my much trouble.
4
12427
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
7
2176
by: halo combat22 | last post by:
I need help on a project i was assigned. I need a way to recognize these numbers. Any help is appreciated.
0
8303
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
8723
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
8502
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
7316
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
5632
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
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
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.