Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Background issue when SaveJPEG utility method (Read 1447 times)
dev
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Sep 28th, 2010
Background issue when SaveJPEG utility method
Sep 28th, 2010 at 2:48pm
Print Post  
I was trying to save the generated diagram as Jpeg.The diagram BackBrush and Background properies are set to white color but when i save that as Jpeg using SaveJPEG() in the utilities i am getting a black backgroud.
Sample code can be downloaded here
https://docs.google.com/uc?id=0B7asc133h1nmYWUyNjY1OTUtYzhlNi00OTgxLTg3MWUtNzliM...

How can i fix this issue.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Background issue when SaveJPEG utility method
Reply #1 - Sep 28th, 2010 at 6:21pm
Print Post  
It seems the diagram does not render its background until the first layout phase. Since you are never adding it to the WPF visual tree, you will have to force layout by calling Measure/Arrange:

Code
Select All
public DiagramGenerator()
{
	InitializeComponent();
		Measure(diagram.Bounds.Size);
		Arrange(diagram.Bounds);
	GenerateDiagram();
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint