Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002693 [JEDI VCL] 00 JVCL Components minor always 2005-02-27 13:23 2005-05-19 08:01
Reporter deks-den View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0002693: TJvSpecialImage raise AV when set Transparent property to True
Description Test situation: create new project, drop TJvSpecialImage on form (name it as "Image"), create Form.OnShow event handler with following code:

begin
  Image.Picture.Assign (Application.Icon);

  Image.Visible := True;
  Image.Transparent := True;
end;

This code always produce AV when setting Transparent to True.
Additional Information I have no idea why it is so, but calling chain leads into TJvImage.ApplyCanges.
Tags No tags attached.
Attached Files zip file icon 2693.zip [^] (2,319 bytes) 2005-05-18 08:39

- Relationships

-  Notes
(0006605)
deks-den (reporter)
2005-02-27 13:26

My TJvSpecialImage.pas file version is 1.11, newest is 1.12, but nothing there is helpfull.
(0006606)
deks-den (reporter)
2005-02-27 13:27

My dev environment is D5 of Win XP.
(0006795)
obones (administrator)
2005-03-31 08:33

This is confirmed under WinXP and Delphi 7 with the latest JVCL
(0007214)
obones (administrator)
2005-05-18 08:45

To anyone:
Please use the attached project, it shows the behaviour. Here are the steps:

Run the App
Click on Set Image. All is fine
Click on Set Transparent. You get an AV.

I've tried to pinpoint the place where it AV's it's in TImage.PictureChanged in ExtCtrls.pas, on this test:

    if (not G.Transparent) and (D.Left <= 0) and (D.Top <= 0) and
       (D.Right >= Width) and (D.Bottom >= Height) then

Evaluation of any property from G gives an AV, you can even crash the debugger.

If you put a breakpoint in TJvSpecialImage.PictureChanged and inspect the value of @Self, it keeps changing everytime the breakpoint hits, which is very strange to me.

I can't figure out why this is happening, please anyone help here.
(0007229)
robert_marquardt (developer)
2005-05-18 12:45
edited on: 2005-05-18 12:48

An Icon is already transparent so TIcon.Transparent is effectively read-only (see help for TIcon.Transparent).
Maybe somewhere the Transparent handling goes wild.
The weak spot of TImage is changes to the bitmap. It triggers Changed which can easily lead to a constant update loop.

(0007230)
remkobonte (developer)
2005-05-18 14:34

G (actually Picture.Graphic) is freed in

G.Transparent := FTransparent;

from TImage.PictureChanged because this triggers the OnChange event of the picture, then:

TJvSpecialImage.PictureChanged -> calls ApplyChanges then
TJvSpecialImage.ApplyChanges -> calls inherited Picture.Assign(Dest) then
TPicture.Assign -> calls TPicture.SetGraphic then

FGraphic is freed, which is Picture.Graphic which is G.

Main problem is thus that Picture.Graphic is set in a Picture.OnChange handler.
(0007248)
obones (administrator)
2005-05-19 08:01

Thanks all, this is now fixed in CVS. Please have a look at version 1.13 and let me know if all is ok.

- Issue History
Date Modified Username Field Change
2005-02-27 13:23 deks-den New Issue
2005-02-27 13:26 deks-den Note Added: 0006605
2005-02-27 13:27 deks-den Note Added: 0006606
2005-03-31 08:33 obones Note Added: 0006795
2005-03-31 08:33 obones version 3.00 BETA 2 => 3.00
2005-03-31 08:35 obones Status new => acknowledged
2005-05-18 08:39 obones File Added: 2693.zip
2005-05-18 08:45 obones Note Added: 0007214
2005-05-18 08:45 obones Status acknowledged => confirmed
2005-05-18 12:45 robert_marquardt Note Added: 0007229
2005-05-18 12:48 robert_marquardt Note Edited: 0007229
2005-05-18 14:34 remkobonte Note Added: 0007230
2005-05-19 08:01 obones Status confirmed => resolved
2005-05-19 08:01 obones Resolution open => fixed
2005-05-19 08:01 obones Assigned To => obones
2005-05-19 08:01 obones Note Added: 0007248


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker