#1 2023-03-20 21:13:10

mrbar2000
Member
From: Brazil
Registered: 2016-10-26
Posts: 85

RTL Error on closing delphi when using SYNGDI

AB,

Do you still provide any support for SynGDI Plus?

I have created a ThumbView component that uses the GR32 lib. In this component I put:

uses
  Windows, Messages, Math, SysUtils, Classes, Controls, Types,
  StdCtrls, Dialogs, Contnrs, CommCtrl, ActiveX, Graphics, Forms,
  GR32_Image, GR32, GR32_Transforms, GR32_RangeBars, GR32_Blend,
  SynGdiPlus,
  BackgroundWorker;

....

//initialization
//  Gdip.RegisterPictures;
end.

When I install the component without this initialization I can close delphi without any problems.

but if i uncomment that initialization Gdip.RegisterPictures, when I close delphi I get the following message

erro.png

Offline

#2 2023-03-21 07:33:50

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,612
Website

Re: RTL Error on closing delphi when using SYNGDI

This is a know restriction (just search in this forum): you can only register one system for pictures.

One of your units is already registering the picture loading format.

Offline

#3 2023-03-21 11:27:46

mrbar2000
Member
From: Brazil
Registered: 2016-10-26
Posts: 85

Re: RTL Error on closing delphi when using SYNGDI

i have commented the picture (GIF) that was registred. the error happen yet

I removed TGifImage of matrixes too

const
  PicturesExt: array[0..4] of TFileName =
    ('jpg','jpeg','png','tif','tiff');
  PictureClasses: array[0..4] of TGraphicClass =
    (TJpegImage,TJpegImage,TPngImage,TTiffImage,TTiffImage);

....

procedure TGDIPlus.RegisterPictures;
var
  i: integer;
begin
  SendDebug('register!');
  // launch Gdip.RegisterPictures to initialize the GDI+ library if necessary
  if (Self=nil) and (Gdip=nil) then
  begin
    SendDebug('gdipo criando!');
    Gdip := TGDIPlus.Create('gdiplus.dll');
  end;
  // register JPG and PNG pictures as TGraphic
  if GetClass('TTiffImage')=nil then
  begin
    RegisterClass(TJpegImage);
    RegisterClass(TPngImage);
    //RegisterClass(TGifImage);   <<<<<<<<<<<<
    RegisterClass(TTiffImage);
    for i := 0 to high(PicturesExt) do
      TPicture.RegisterFileFormat(PicturesExt[i],
        PictureName(PictureClasses[i]),PictureClasses[i]);
  end;
end;

Offline

#4 2023-03-21 15:03:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,612
Website

Re: RTL Error on closing delphi when using SYNGDI

Remove the whole TGDIPlus.RegisterPictures call, then call manualy RegisterClass() and/or TPicture.RegisterFileFormat for the format you are sure is unique.

Offline

#5 2023-03-21 16:28:33

mrbar2000
Member
From: Brazil
Registered: 2016-10-26
Posts: 85

Re: RTL Error on closing delphi when using SYNGDI

I can do this into component, or i will need call manually into application when using the component?

Offline

Board footer

Powered by FluxBB