Thema: Delphi Class field lost value!

Einzelnen Beitrag anzeigen

alzaimar
(Moderator)

Registriert seit: 6. Mai 2005
Ort: Berlin
4.956 Beiträge
 
Delphi 2007 Enterprise
 
#4

Re: Class field lost value!

  Alt 27. Feb 2010, 06:39
So why do you create another TBrighnessAdjustmentLayer then?
This should work (I removed the 'create' and got rid of some begin/end and other unimportant stuff):
Delphi-Quellcode:
var
  Index: Integer;
  Layer: TCustomFilterLayer;
begin
  Index := lbLayers.ItemIndex;

  if Index <> - 1 then
    if lbLayers.Items.Objects[Index] is TCustomFilterLayer then begin
      Layer := lbLayers.Items.Objects[Index] as TCustomFilterLayer;
      if Layer is TBrightnessAdjustmentLayer then
          SetAmount(vtInteger, -100, 100, TBrightnessAdjustmentLayer(Layer).Amount);
    end;
end;
"Wenn ist das Nunstruck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput!"
(Monty Python "Joke Warefare")
  Mit Zitat antworten Zitat