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

bool wxPdfDocument::Image ( const wxString &  name,
wxInputStream &  stream,
const wxString &  mimeType,
double  x,
double  y,
double  w = 0,
double  h = 0,
const wxPdfLink link = wxPdfLink(-1),
int  maskImage = 0 
) [virtual]

Puts an image in the page The image is given by an wxInputStream-Object containing the raw image data.

name Name of the image to be used as an identifier for this image object.
stream wxInputStream object containing the raw image data
mimeType Image format. Possible values are: image/jpeg, image/png, image/gif, image/wmf.
x Abscissa of the upper-left corner.
y Ordinate of the upper-left corner.
w Width of the image in the page. If not specified or equal to zero, it is automatically calculated.
h Height of the image in the page. If not specified or equal to zero, it is automatically calculated.
link URL or identifier returned by AddLink().
maskImage Id of an image mask created previously by ImageMask().

Definition at line 1528 of file pdfdoc.cpp.

References wxPdfImage::GetMaskImage(), Image(), OutImage(), wxPdfImage::Parse(), and wxPdfImage::SetMaskImage().

  bool isValid = false;
  wxPdfImage* currentImage = NULL;
  // Put an image on the page
  wxPdfImageHashMap::iterator image = (*m_images).find(name);
  if (image == (*m_images).end())
    // First use of image, get info
    int i = (*m_images).size() + 1;
    currentImage = new wxPdfImage(this, i, name, stream, mimeType);
    if (!currentImage->Parse())
      delete currentImage;
      if (wxImage::FindHandler(wxBITMAP_TYPE_PNG) == NULL)
        wxImage::AddHandler(new wxPNGHandler());
      wxImage tempImage;
      tempImage.LoadFile(stream, mimeType);
      if (tempImage.Ok())
        isValid = Image(name, tempImage, x, y, w, h, link, maskImage);
      return isValid;

    if (maskImage > 0)
    (*m_images)[name] = currentImage;
    currentImage = image->second;
    if (maskImage > 0 && currentImage->GetMaskImage() != maskImage)
  OutImage(currentImage, x, y, w, h, link);
  isValid = true;
  return isValid;

Generated by  Doxygen 1.6.0   Back to index