ImageEn, unit iexBitmaps

TIEBitmap.SaveState

TIEBitmap.SaveState


Declaration

procedure SaveState();


Description

Pushes the current TIEBitmap state onto the states stack so it can be restored later calling RestoreState.

Note: When LegacyBitmap = True, applications should block TImageEnView updates between calls to SaveState() and RestoreState(), calling TImageEnView.LockUpdate() and TImageEnView.UnlockUpdate().


Example

// Merges alpha channel to save image as BMP, and restore it
ImageEnView1.IO.LoadFromFile('input.png');
ImageEnView1.IEBitmap.SaveState();
ImageEnView1.RemoveAlphaChannel(true);
ImageEnView1.IO.SaveToFile('output.bmp');
ImageEnView1.IEBitmap.RestoreState();

// Same as above, but with ImageEnView1.LegacyBitmap = False
ImageEnView1.IO.LoadFromFile('input.png');
ImageEnView1.LockUpdate();
ImageEnView1.IEBitmap.SaveState();
ImageEnView1.RemoveAlphaChannel(true);
ImageEnView1.IO.SaveToFile('output.bmp');
ImageEnView1.IEBitmap.RestoreState();
ImageEnView1.UnlockUpdate();