PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jul 05, 2024 7:28 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: custom table row color
PostPosted: Mon Feb 07, 2011 8:32 pm 
Offline

Joined: Mon Feb 07, 2011 8:22 pm
Posts: 2
I am trying to specify an exact color for my table row.
I tried using:
Code:
row.Shading.Color = Color.Parse("0xBBCCDD");

For some reason this will only shade the first color of the first cell.
If I use
Code:
row.Shading.Color = Colors.Blue;

then it shades the entire row, but I want to use particular colors.

I've also tried the Color.Parse idea on individual cells, but it doesn't give me any color.

I'm still learning this tool and have been modifying the tables section from the HelloMigraDoc sample.

Any tips?


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 07, 2011 8:47 pm 
Offline

Joined: Mon Feb 07, 2011 8:22 pm
Posts: 2
All is well now. After examining the colors source I figured out that just needed to place an "FF" before the color that I want:
Code:
row.Shading.Color = Color.Parse("0xFFBBCCDD");


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 08, 2011 2:14 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
You can use int values instead of the string:
Code:
new Color(76, 137, 187)


And this should also work:
Code:
new Color(0xFFBBCCDD);

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 52 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group