Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic The text is get degraded when special setting. (Read 3149 times)
geanyee
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Feb 12th, 2010
The text is get degraded when special setting.
Jun 9th, 2011 at 8:16am
Print Post  
Smiley

Hi team,

I encountered a strange problem when I used the Diagram component.

If the ImageFormat type is set to - image/png

and the backbrush is set to transparent - diagramView.Diagram.BackBrush = new SolidBrush(Color.Transarent).

When preview the diagram, the geneated text is get degraded and is not very clear.

Please take a look the image to see the effect.
.

Since we need to set the backbrush of the diagra view via image method, so it seems like we have to set the brush to transparent to show the real brush on the background of page.

Is there a way to solve this problem? Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: The text is get degraded when special setting.
Reply #1 - Jun 9th, 2011 at 8:58am
Print Post  
Hi, do you mean print preview?
  
Back to top
 
IP Logged
 
geanyee
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Feb 12th, 2010
Re: The text is get degraded when special setting.
Reply #2 - Jun 9th, 2011 at 9:48am
Print Post  
Stoyo wrote on Jun 9th, 2011 at 8:58am:
Hi, do you mean print preview?


No, it's not print preview, we're just show it the diagram on the web. I have made a demo to show the problem, how can I upload it on the server?

This is the code snippet:
HTML-
<ndiag:DiagramView ID="diagramView" runat="server" ClientSideMode="ImageMap" ImageFormat="image/png">
</ndiag:DiagramView>

Code.cs -
diagramView.Diagram.BackBrush = new MindFusion.Drawing.SolidBrush(Color.Transparent);

Then if you view the page, you can see the problem.

Another point is "When text is in a non-transparent object it’s fine. When the object is made transparent it get degraded."
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: The text is get degraded when special setting.
Reply #3 - Jun 9th, 2011 at 9:51am
Print Post  
Please email the demo to support@mindfusion.eu.
  
Back to top
 
IP Logged
 
geanyee
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Feb 12th, 2010
Re: The text is get degraded when special setting.
Reply #4 - Jun 9th, 2011 at 10:23am
Print Post  
Stoyo wrote on Jun 9th, 2011 at 9:51am:
Please email the demo to support@mindfusion.eu.


Hi, I have sent the demo to the email, thanks for your replying.

Hoping yours feedback.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: The text is get degraded when special setting.
Reply #5 - Jun 9th, 2011 at 2:52pm
Print Post  
Apparently the transparent background confuses a bit the Windows' ClearType text rendering. We could add some property that will let you change the text antialiasing method to a different one when you need a transparent background. The other methods do not look as good as ClearType on solid background, but are much better than ClearType on transparent background. You can see their effect with some custom drawing:

Code
Select All
diagramView.Diagram.DrawForeground += Diagram_DrawForeground;

void Diagram_DrawForeground(object sender, MindFusion.Diagramming.DiagramEventArgs e)
{
	var d = diagramView.Diagram;
	e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
	e.Graphics.DrawString("test", d.Font, Brushes.Black, 50, 100);
} 

  
Back to top
 
IP Logged
 
geanyee
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Feb 12th, 2010
Re: The text is get degraded when special setting.
Reply #6 - Jun 10th, 2011 at 2:17am
Print Post  
Thanks for your suggestion, it can solve the problem that the text is directly draw on the diagram.

However, it still has the problem that when the shape's transparent is set to True and the shape is included in the diagram. In this salutation, the text that displayed on the shape is degraded also.

I also tried:
diagramView.Diagram.DrawNode += new MindFusion.Diagramming.DrawNodeEventHandler(Diagram_DrawNode);
void Diagram_DrawNode(object sender, MindFusion.Diagramming.DrawNodeEventArgs e)
       {
           e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
       }

But it still does not solve the problem. Do you have any other suggestion? Thanks again.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: The text is get degraded when special setting.
Reply #7 - Jun 10th, 2011 at 6:12am
Print Post  
As I said we'll have to add a new property that will set TextRenderingHint for all of the control's text drawing code. That sample was intended to just let you see the effect of different antialiasing methods.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint