Free Support Forum - aspose.com

Rendering of brightness and contrast

Powerpoint 2003 (maybe others) has a setting that allows the user to set the brightness and contrast of a graphic.

GetThumbnail does not render these settings but they are maintained in the PPT file.

Is this something that will be implemented later?

Thanks,
JP




Dear JP,

There is a workaround. There are two properties of PictureFrame, namely PictureFrame.Brightness and PictureFrame.Contrast. You can take the image of your slide and add it into a new pictureframe and then modify its brightness and contrast and retake the slide image using Getthumbnail method.

I’m not sure I understand.

I’ve attached a sample ppt and when I import it. I see the pictures in the shape collection that are pictureframe types. I can also see that the brightness and contrast variables are correct.

I guess I’m not following what you are describing as a workaround.

Please see this code, output presentation generated by it is attached. The code takes the slide image of first slide, add new slide and add the image in it and change its contrast. Please see second slide.

The code is in C#

void ChangingContrast()

{

Presentation srcPres = new Presentation(@"c:\Source PPTs\srcSlide.ppt");

Slide srcSld = srcPres.GetSlideByPosition(1);

Image srcImg = srcSld.GetThumbnail(1, 1);

//Get the image in a stream

MemoryStream ms = new MemoryStream();

ms.Position = 0;

srcImg.Save(ms, ImageFormat.Bmp);

//Add new slide, add the image as a pictureframe on it and then change its contrast

Slide newSld = srcPres.AddEmptySlide();

ms.Position = 0;

Picture pic = new Picture(srcPres, ms);

int picId = srcPres.Pictures.Add(pic);

PictureFrame pf = newSld.Shapes.AddPictureFrame(picId, 0, 0, srcPres.SlideSize.Width, srcPres.SlideSize.Height);

//Set its contrast to 30%

pf.Contrast = 30;

//Now view the second slide with the image of first slide having 30% contrast.

//Finally, you can get the thumbnail image of second slide

//Please see second slide

srcPres.Write(@"c:\outcontrast.ppt");

}

Dear JP,

Our Java version of Aspose.Slides already supports rendering images with custom brightness and contrast.
I think we will also implement the same functionality in the .Net version in the nearest future.

Ok, That makes things clear.

Thanks,
JP


Hey guys,

I wanted to check in and see if there is any news on this issue.

Is this issue going to be resolved soon?

Thanks,
JP

hi guys,

I saw that 2.7.7 is out. However, I still see the thumbnails don’t reflect the brightness/contrast settings in PowerPoint.

Is this feature still in the plans?

Thanks,
JP

Most probably it will be implemented somewhere in January.