View Issue Details

IDProjectCategoryView StatusLast Update
0002888JEDI VCL00 JVCL Componentspublic2006-06-08 02:33
ReportermatthiusAssigned Toobones 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.30 
Summary0002888: Jv Leds make errors so not leave memory complete ( Jv Trans Led makes only an error ) in a TStatusBar ( resolved changing code )
DescriptionHere is the code that makes an error and a memory unfree in JvTransLed on a statusbar :

procedure TJvTransLED.SetColor(Value: TColor);
var
    X, Y: Integer;
begin
    if Value <> FColor then
    begin
        FColor := Value;
        FImgPict.LoadFromResourceName(HInstance, cGreenLEDName);
        FImgPict.PixelFormat := pf24bit;
        for X := 0 to FImgPict.Width-1 do
            for Y := 0 to FImgPict.Height-1 do
                if FImgPict.Canvas.Pixels[X, Y] = clLime then
                    FImgPict.Canvas.Pixels[X, Y] := Color;
        Repaint;
    end;
end;
Additional InformationHere is the code that not makes error : It seems that the PixelFormat at pfDevice adapts itself at the TStatusBar :

procedure TJvTransLED.SetColor(Value: TColor);
var
    X, Y: Integer;
begin
    if Value <> FColor then
    begin
        FColor := Value;
        FImgPict.LoadFromResourceName(HInstance, cGreenLEDName);
        FImgPict.PixelFormat := pfDevice;
        FImgPict.Canvas.Lock;
        for X := 0 to FImgPict.Width-1 do
            for Y := 0 to FImgPict.Height-1 do
                if FImgPict.Canvas.Pixels[X, Y] = clLime then
                    FImgPict.Canvas.Pixels[X, Y] := Color;
        FImgPict.Canvas.UnLock;
        Repaint;
    end;
end;
TagsNo tags attached.

Activities

edbored

2005-08-23 18:57

reporter   ~0007840

Tested this with
MemProof - reports a palette entry not destroyed
MemSleuth - nothing amiss
FastMM425 - nothing amiss

Modified JvLED.pas
 procedure TJvCustomLED.ColorChanged;

to use pfDevice instead of pf24Bit and tested again.

All three memory/resource tools report "nothing amiss."

Tested modified control under W2K 8bit, 16bit amd 24bit graphics mode - no problems.


D7E, jcl/jvcl updated from cvs Aug 18.

If there is no specific reason to use pf24Bit then maybe change to pfDevice and close this.


EdB

obones

2006-04-03 03:35

administrator   ~0008819

Please have a look at the latest code from the latest version of the JVCL. Then tell us if the problem you reported is still here, I suspect it's already fixed.

obones

2006-06-08 02:33

administrator   ~0009431

Well, no news, assuming this is fixed by the latest daily:

http://jvcl.sf.net/daily/

Issue History

Date Modified Username Field Change
2005-04-18 08:37 matthius New Issue
2005-08-23 18:57 edbored Note Added: 0007840
2006-04-03 03:35 obones Note Added: 0008819
2006-04-03 03:35 obones Status new => feedback
2006-06-08 02:33 obones Status feedback => resolved
2006-06-08 02:33 obones Resolution open => fixed
2006-06-08 02:33 obones Assigned To => obones
2006-06-08 02:33 obones Note Added: 0009431