lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Failing more gracefully with missing PNG files


From: Greg Chicares
Subject: Re: [lmi] Failing more gracefully with missing PNG files
Date: Wed, 16 Sep 2015 21:05:18 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

On 2015-09-15 22:56, Greg Chicares wrote:
> [...] the renaming
>   background.png --> group_quote_banner.png
>   logo.png       --> company_logo.png
> that I'm about to commit separately

BTW...

http://svn.savannah.nongnu.org/viewvc/lmi/trunk/group_quote_pdf_gen_wx.cpp?root=lmi&r1=6274&r2=6278&diff_format=u

...clearly I can rename this local variable of type wxImage:

-    wxImage background_image(load_image("background.png"));
+    wxImage banner_image(load_image("group_quote_banner.png"));

...but it was less immediately clear to me that I can also
change the first argument here:

-    pdf_doc->Image("background", background_image, 0, *pos_y);
+    pdf_doc->Image("banner", banner_image, 0, *pos_y);

But AFAICT any name will do, so we may as well use the most descriptive one:

http://wxcode.sourceforge.net/docs/wxpdfdoc/classwx_pdf_document.html#ac8b4b1631468c33afed1e4347bc37168

virtual bool wxPdfDocument::Image(const wxString & name,
                                  const wxImage & image,
...
name    Name of the image to be used as an identifier for this image object.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]