Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SVG expport problem (Read 3614 times)
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
SVG expport problem
Nov 23rd, 2010 at 7:44am
Print Post  
Hi there!

I have exported a diagram to SVG and found the a text that is drawn by custom code is moved in svg. Find attached an with the result (in Firefox). .
The right is displayed in the diagram and the left is how it is viewed in Firefox.

The rectangle and text are drawn at the same location the the size of the rectangle is the size of the text given by the measurestring method.

Does anybody have any idea why this is happening?

Best regards,
Dexter
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG expport problem
Reply #1 - Nov 23rd, 2010 at 3:02pm
Print Post  
Hi, Are you using the DrawString(RectangleF) overload?
  
Back to top
 
IP Logged
 
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Re: SVG expport problem
Reply #2 - Nov 24th, 2010 at 7:14am
Print Post  
Hi Stoyo!

Here is the code that draws the text and the rectangle

Code
Select All
Pen pen = base.HeadPen.CreateGdiPen();
Brush brush = new SolidBrush(this.TextColor);

string text2Draw = "pm"
SizeF textSize = graphics.MeasureString(text2Draw, this.Font);

graphics.DrawRectangle(pen, stringLocation.X, stringLocation.Y, textSize.Width, textSize.Height);
graphics.DrawString(text2Draw, this.Font, brush, stringLocation);

pen.Dispose();
brush.Dispose();
 



The stringLocation is calculated based on some particular parameters.

The graphics is the parameter from the override Draw method

Regards,
Dexter
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG expport problem
Reply #3 - Nov 24th, 2010 at 7:35am
Print Post  
Hi Dexter,

Is stringLocation a PointF or RectangleF?

Stoyan
  
Back to top
 
IP Logged
 
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Re: SVG expport problem
Reply #4 - Nov 24th, 2010 at 10:21am
Print Post  
Hi Stoyo,

stringLocation is a PointF structure.

Dexter
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG expport problem
Reply #5 - Nov 25th, 2010 at 7:58am
Print Post  
This version should add a smaller offset at front of the string:
https://mindfusion.eu/_beta/fcnet55.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Re: SVG expport problem
Reply #6 - Jan 26th, 2011 at 3:05pm
Print Post  
Hi Stoyo!

I just read that you are planing a new release of version v5.6. Does this problem, or should I better say, the solution you provided here is solved there

Regards
Dexter
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG expport problem
Reply #7 - Jan 26th, 2011 at 3:25pm
Print Post  
Hi Dexter,

That fix should be included in v5.5, which we released in December last year.

Regards,
Stoyan
  
Back to top
 
IP Logged
 
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Re: SVG expport problem
Reply #8 - Jan 26th, 2011 at 3:31pm
Print Post  
I see!

On the download page for the flowchart.net there is version v5.4 http://mindfusion.eu/download-net.html

Probably there is spelling mistake.

Best regards,
Dexter
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint