View Issue Details

IDProjectCategoryView StatusLast Update
0002693JEDI VCL00 JVCL Componentspublic2005-05-19 08:01
Reporterdeks-denAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.10 
Summary0002693: TJvSpecialImage raise AV when set Transparent property to True
DescriptionTest 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 InformationI have no idea why it is so, but calling chain leads into TJvImage.ApplyCanges.
TagsNo tags attached.

Activities

deks-den

2005-02-27 13:26

reporter   ~0006605

My TJvSpecialImage.pas file version is 1.11, newest is 1.12, but nothing there is helpfull.

deks-den

2005-02-27 13:27

reporter   ~0006606

My dev environment is D5 of Win XP.

obones

2005-03-31 08:33

administrator   ~0006795

This is confirmed under WinXP and Delphi 7 with the latest JVCL

2005-05-18 08:39

 

2693.zip (2,319 bytes)

obones

2005-05-18 08:45

administrator   ~0007214

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.

robert_marquardt

2005-05-18 12:45

developer   ~0007229

Last edited: 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.

remkobonte

2005-05-18 14:34

developer   ~0007230

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.

obones

2005-05-19 08:01

administrator   ~0007248

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 Product 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