I've been experimenting with ImageEn for a few days now and I'm really impressed of its functionality!
Right now I'm implementing a trackbar to adjust the contrast and I'm not sure I'm applying it correctly. The trackbar should adjust the contrast of the loaded image in real-time, which works properly.
Info: In order to optimize the performance, I first resize the image to match the TImageEnView's dimensions.
Here is the source code:
procedure TForm1.FormCreate(Sender: TObject);
ImageEnView1.IEBitmap.Resample(ImageEnView1w.Width, ImageEnView1.Height, rfFastLinear, true, true);
procedure TForm1.TrackBar1Changing(Sender: TObject; NewPos: Integer;
var AllowChange: Boolean);
ImageEnView1.Proc.AdjustBrightnessContrastSaturation(0, NewPos, 0);
Since I want to adjust the original image's contrast (not the contrast of changed image), I use Proc.Undo to "reset" the image and ClearRedo to keep the memory clean. Is there a better way than using Undo maybe?
Thanks in advance!