ImageEn

TImageEnProc.CastAlphaRange Code Samples


Code samples for CastAlphaRange.
Automatically generated by the Every Method demo.
// Automated test of CastAlphaRange - Typical Values
// CastAlphaRange - Reduce to 4 Alpha Values
alphaCount := 4;         // Number of alpha channel values
a := 255 / alphaCount;   // Range of each alpha band
ImageEnView1.LockUpdate();
ImageEnView1.IEBitmap.AlphaFill( 0, 255 );  // Add an alpha gradient to the image
for i := alphaCount - 1 downto 0 do
  ImageEnView1.Proc.CastAlphaRange( Round( i * a ), Round( (i+1) * a ), Round( (i+1) * a ));
ImageEnView1.UnlockUpdate();



// Automated test of CastAlphaRange - Alpha Channel - Typical Values
// CastAlphaRange - Reduce to 4 Alpha Values
alphaCount := 4;         // Number of alpha channel values
a := 255 / alphaCount;   // Range of each alpha band
ImageEnView1.LockUpdate();
ImageEnView1.IEBitmap.AlphaFill( 0, 255 );  // Add an alpha gradient to the image
for i := alphaCount - 1 downto 0 do
  ImageEnView1.Proc.CastAlphaRange( Round( i * a ), Round( (i+1) * a ), Round( (i+1) * a ));
ImageEnView1.UnlockUpdate();



// Automated test of CastAlphaRange - 32-Bit RGBA - Typical Values
// CastAlphaRange - Reduce to 4 Alpha Values
alphaCount := 4;         // Number of alpha channel values
a := 255 / alphaCount;   // Range of each alpha band
ImageEnView1.LockUpdate();
ImageEnView1.IEBitmap.AlphaFill( 0, 255 );  // Add an alpha gradient to the image
for i := alphaCount - 1 downto 0 do
  ImageEnView1.Proc.CastAlphaRange( Round( i * a ), Round( (i+1) * a ), Round( (i+1) * a ));
ImageEnView1.UnlockUpdate();



// Automated test of CastAlphaRange - 1-bit - Typical Values
// CastAlphaRange - Reduce to 4 Alpha Values
alphaCount := 4;         // Number of alpha channel values
a := 255 / alphaCount;   // Range of each alpha band
ImageEnView1.LockUpdate();
ImageEnView1.IEBitmap.AlphaFill( 0, 255 );  // Add an alpha gradient to the image
for i := alphaCount - 1 downto 0 do
  ImageEnView1.Proc.CastAlphaRange( Round( i * a ), Round( (i+1) * a ), Round( (i+1) * a ));
ImageEnView1.UnlockUpdate();



// Automated test of CastAlphaRange - Random Values
// CastAlphaRange - Reduce to 16 Alpha Values
alphaCount := 16;         // Number of alpha channel values
a := 255 / alphaCount;   // Range of each alpha band
ImageEnView1.LockUpdate();
ImageEnView1.IEBitmap.AlphaFill( 0, 255 );  // Add an alpha gradient to the image
for i := alphaCount - 1 downto 0 do
  ImageEnView1.Proc.CastAlphaRange( Round( i * a ), Round( (i+1) * a ), Round( (i+1) * a ));
ImageEnView1.UnlockUpdate();



// Automated test of CastAlphaRange - Alpha Channel - Random Values
// CastAlphaRange - Reduce to 16 Alpha Values
alphaCount := 16;         // Number of alpha channel values
a := 255 / alphaCount;   // Range of each alpha band
ImageEnView1.LockUpdate();
ImageEnView1.IEBitmap.AlphaFill( 0, 255 );  // Add an alpha gradient to the image
for i := alphaCount - 1 downto 0 do
  ImageEnView1.Proc.CastAlphaRange( Round( i * a ), Round( (i+1) * a ), Round( (i+1) * a ));
ImageEnView1.UnlockUpdate();



// Automated test of CastAlphaRange - 32-Bit RGBA - Random Values
// CastAlphaRange - Reduce to 16 Alpha Values
alphaCount := 16;         // Number of alpha channel values
a := 255 / alphaCount;   // Range of each alpha band
ImageEnView1.LockUpdate();
ImageEnView1.IEBitmap.AlphaFill( 0, 255 );  // Add an alpha gradient to the image
for i := alphaCount - 1 downto 0 do
  ImageEnView1.Proc.CastAlphaRange( Round( i * a ), Round( (i+1) * a ), Round( (i+1) * a ));
ImageEnView1.UnlockUpdate();



// Automated test of CastAlphaRange - 1-bit - Random Values
// CastAlphaRange - Reduce to 16 Alpha Values
alphaCount := 16;         // Number of alpha channel values
a := 255 / alphaCount;   // Range of each alpha band
ImageEnView1.LockUpdate();
ImageEnView1.IEBitmap.AlphaFill( 0, 255 );  // Add an alpha gradient to the image
for i := alphaCount - 1 downto 0 do
  ImageEnView1.Proc.CastAlphaRange( Round( i * a ), Round( (i+1) * a ), Round( (i+1) * a ));
ImageEnView1.UnlockUpdate();