#1 2019-05-21 11:55:09

ianxevcd
Member
Registered: 2016-07-04
Posts: 11

A class named TJPEGImage already exists

Hi,
I think there should be a check if the class is already registered in TGDIPlus.RegisterPictures. I use 3rd-party component where Jpeg and PngImage classes registered too. So, when It loads before mormot I got exception there.


Alexander

Offline

#2 2019-05-21 13:50:50

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: A class named TJPEGImage already exists

If you do not need the classes to be registered, do not call TGDIPlus.RegisterPictures method.

I use this to init Gdip without registering:

if Gdip = nil then
Gdip := TGDIPlus.Create('gdiplus.dll');  

Make this call in the FormCreate event of the main application form, or in the "initialization" of the unit.

Last edited by macfly (2019-05-21 13:52:25)

Offline

#3 2019-05-22 09:59:40

ianxevcd
Member
Registered: 2016-07-04
Posts: 11

Re: A class named TJPEGImage already exists

I don't call this method in my code.


Alexander

Offline

#4 2019-05-22 18:27:27

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: A class named TJPEGImage already exists

Do a global search to see if RegisterPictures is being called somewhere in your project, or dependent units.

And check if NOTSYNPICTUREREGISTER was defined or undefined.

In SynGdiPlus.pas (154) It is defined as:

{$define NOTSYNPICTUREREGISTER}

Offline

Board footer

Powered by FluxBB