WPCubed Product Support

PNGIMG conflitcs with GraphicEX?

Hello Julian,

I'm currently using WpTools 6.25.4 with the GraphicEx library on Delphi XE2.

I've noticed though that PNG images are no longer loaded correctly. I can add an image, save it to a RTF file. But when i load that RTF file the image is no longer visible.

When disabling the PNGIMG compiler define in WPOBJ_Image i nog longer have problems.

This is where i get confused though:

WPINC.inc reads:

// Activate this define to use TPNGImage to load PNG and GIF files.
// If you use also GraphicEx you
// should deativate the PNG support in GraphicConfiguration.inc
// --> see unit WPObj_Image
// (Delphi 2009+ containes PNGImage)
{.$DEFINE PNGIMG}

WPOBJ.Image.pas read:

{$IFDEF UNICODE} //Delphi 2009 and later includes PNG support
{$DEFINE PNGIMG}
{$ENDIF}

// GraphicEx cannot be used together with PNGLib and GifImage

{$IFDEF GIFIMG}{$IFDEF PNGIMG}{$UNDEF GRAPHICEX}{$ENDIF}{$ENDIF}

{$IFDEF GIFIMG}
{$MESSAGE Warn '*** GifImage included due to compiler symbol "GIFIMG"'}
{$IFDEF GRAPHICEX}
Info:
You cannot use GRAPHICEX and GIFIMG at the same time. Please use
GIFIMG and PNGIMG instead.
{$ENDIF}
{$ENDIF}

It looks like GIFIMG is not included in my setup. So the GraphicEx remains defined.
I've then tried deactivating PNG support in GraphicConfiguration.inc as suggested, but with GraphicEx defined WpTools will then no longer compile ("undeclared identifier TPNGImage").

I'm not really sure how it is supposed to work

Should i disable PNGImg?
Should i disable GraphicEx?
Should i enable GifImg?

Since GraphicEx supports a lot of different formats disabling it entirely for just native PNG and GIF supports doesn't seem like a very good trade.

#1 ♥ 0
9.8k Views 3 users read 3 min

Is there any advise you could give?

I don't think i'm doing anything that is not supported by WpTools

#2 ♥ 0
support

Hi,

GraphicEx is somehow redundant - since PNGLib is now part of Delphi.
I would disable GraphicEx for WPTools.

RTF also only supports PNG and JPEG.

Julian

#3 ♥ 0

I implemented an email client that displays emails in HTML format. I had the problem that all images were displayed except GIFs. I had to experiment a bit to find a solution.

This is how I do it now (for Delphi XE2):

In WPObjImage.pas I changed two things:

Original:
{-$DEFINE GIFIMG}

My version:
{$DEFINE GIFIMG}

Original:
{$IFDEF GIFIMG}, {$IFDEF DEL2007ANDUP}gifimg{$ELSE}gifimage{$ENDIF}{$ENDIF}

My version:
{$IFDEF GIFIMG}, {$IFDEF DEL2007ANDUP}Vcl.Imaging.GIFImg{$ELSE}gifimage{$ENDIF}{$ENDIF}

#4 ♥ 0
support

I am going to do it like this (in wptools 7):

{$IFDEF DEL2007ANDUP}
{$IFDEF DELPHIXE} Vcl.Imaging.GIFImg {$ELSE} gifimg {$ENDIF}
{$ELSE}gifimage{$ENDIF}{$ENDIF}

Please note that you can add compiler symbols to the Project Options and also add unit Default namespaces there.

#5 ♥ 0
This category is archived. No new posts are possible.