Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

int wxPdfDocument::ImageMask ( const wxString &  file,
const wxString &  mimeType = wxEmptyString 
) [virtual]

Prepares an image for use as an image mask The image is given as the name of the file conatining the image

Parameters:
fileName of the file containing the image.
mimeTypeImage format. Possible values are: image/jpeg, image/png, image/gif, image/wmf.
Returns:
id of the image mask, or 0 in case of an error

Definition at line 1586 of file pdfdoc.cpp.

References wxPdfImage::GetColorSpace(), wxPdfImage::GetIndex(), m_PDFVersion, and wxPdfImage::Parse().

Referenced by Image().

{
  int n = 0;
  wxPdfImage* currentImage = NULL;
  // Put an image on the page
  wxPdfImageHashMap::iterator image = (*m_images).find(file);
  if (image == (*m_images).end())
  {
    // First use of image, get info
    n = (*m_images).size() + 1;
    currentImage = new wxPdfImage(this, n, file, type);
    if (!currentImage->Parse())
    {
      delete currentImage;
      return 0;
    }
    // Check whether this is a gray scale image (must be)
    if (currentImage->GetColorSpace() != _T("DeviceGray"))
    {
      delete currentImage;
      return 0;
    }
    (*m_images)[file] = currentImage;
  }
  else
  {
    currentImage = image->second;
    n = currentImage->GetIndex();
  }
  if (m_PDFVersion < _T("1.4"))
  {
    m_PDFVersion = _T("1.4");
  }
  return n;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index