PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllConverts image colors to the shades of gray.
|
| HRESULT MakeImageGrayScale ( LONG imageIndex ) |
Parameters
imageIndex
Image index.
Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.
Remarks
Image index can be retrieved from any image loading method, like AddImageFromFile.
Analogue in new interface: IPDFDocument4::TransformImage.
Example
How to make an image gray
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
j := PDF.AddImageFromFile('picture.jpg');
PDF.MakeImageGrayScale(j);
PDF.PDFPAGE_ShowImage(j, 200, 0, 122, 89, 0);
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
LONG j = PDF->AddImageFromFile("picture.jpg");
PDF->MakeImageGrayScale(j);
PDF->PDFPAGE_ShowImage(j, 200, 0, 122, 89, 0);
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
long j = PDF.AddImageFromFile("picture.jpg");
PDF.MakeImageGrayScale(j);
PDF.PDFPAGE_ShowImage(j, 200, 0, 122, 89, 0);
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc
j = PDF.AddImageFromFile("picture.jpg")
PDF.MakeImageGrayScale j
PDF.PDFPAGE_ShowImage j, 200, 0, 122, 89, 0
PDF.EndDoc
See Also
Reference


