We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to do Transparent graphic in Grid Cell

I need to put an indicator occasionally into a cell (check box).  I also need to color a row sometimes.  unfortunately I can only figure out how to put JPEG into the cell and they don't do transparency.  A non-transparent JGP looks awful in the Grid.

While I'm at it, is there someway to scale the graphic I'm inserting or does it need to be the right size right from the beginning?

Your help would be appreciated.

3 Replies

KC Karthikeyan Chandrasekar Syncfusion Team October 27, 2014 12:02 PM UTC

Hi Mark,

Thank you for your interest in Syncfusion Products.

 

At present we do have only support for JEPG images to draw in PDF document in WinRT platform. We can scale the graphics by using the below code snippet. Please let us know if you have any concern.

page.Graphics.ScaleTransform(2F, 2F);

 

Thanks,

Karthikeyan.C



SG Sakthi G Syncfusion Team November 17, 2014 04:59 AM UTC

From: Mark Schramm [mailto:markbschramm@hotmail.com]
Sent: Friday, November 14, 2014 5:02 PM
To: Syncfusion Support
Subject: RE: Syncfusion support community forum 117465, How to do Transparent graphic in Grid Cell, has been updated.

 

This scales the entire grid down.

 

I have a Grid.  Inside that grid are 3 columns.  In each of the columns is going to be an icon.  Right now the icon is too big.  Unfortunately the code you provided below scales the entire page and I just want to make the icons fit in the space provided.



KC Karthikeyan Chandrasekar Syncfusion Team November 17, 2014 07:01 AM UTC

Hi Mark,

Thank you for your update.

 

We can save the graphics state and restore this back, please use the below code snippet to implement this.

            //Save the current Graphics State

            PdfGraphicsState gs = page.Graphics.Save();

            //Scale the Graphics

            page.Graphics.ScaleTransform(2F, 2F);

            //Draw the string with scaled graphics

            page.Graphics.DrawString("Hello World", titleFont, PdfBrushes.Black, new PointF(150, 150));

            //Restore graphics to saved state

            page.Graphics.Restore(gs);

            //Draw the string with normal state

            page.Graphics.DrawString("Hello World", titleFont, PdfBrushes.Black, new PointF(250, 150));

 

Regards,

Karthikeyan.C


Loader.
Live Chat Icon For mobile
Up arrow icon