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
0002888 [JEDI VCL] 00 JVCL Components major always 2005-04-18 08:37 2006-06-08 02:33
Reporter matthius View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0002888: Jv Leds make errors so not leave memory complete ( Jv Trans Led makes only an error ) in a TStatusBar ( resolved changing code )
Description Here 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 Information Here 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;
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0007840)
edbored (reporter)
2005-08-23 18:57

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
(0008819)
obones (administrator)
2006-04-03 03:35

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.
(0009431)
obones (administrator)
2006-06-08 02:33

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


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