ImageEn

TImageEnView.SelectionMask Code Samples


Code samples for SelectionMask.
Automatically generated by the Every Method demo.
// Automated test of SelectionMask - 1bit - Typical Values
// Edit the Selection Mask (1bit) and adjust luminance
ImageEnView1.SelectionMaskDepth := 1;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    if _InsideBox( ix, iy ) then
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 1 )
    else
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 0 );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.Proc.AdjustLumSatHistogram( 0.00, 0.85 );



// Automated test of SelectionMask - 1bit - Alpha Channel - Typical Values
// Edit the Selection Mask (1bit) and adjust luminance
ImageEnView1.SelectionMaskDepth := 1;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    if _InsideBox( ix, iy ) then
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 1 )
    else
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 0 );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.Proc.AdjustLumSatHistogram( 0.00, 0.85 );



// Automated test of SelectionMask - 1bit - 32-Bit RGBA - Typical Values
// Edit the Selection Mask (1bit) and adjust luminance
ImageEnView1.SelectionMaskDepth := 1;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    if _InsideBox( ix, iy ) then
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 1 )
    else
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 0 );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.Proc.AdjustLumSatHistogram( 0.00, 0.85 );



// Automated test of SelectionMask - 1bit - 1-bit - Typical Values
// Edit the Selection Mask (1bit) and clear
ImageEnView1.SelectionMaskDepth := 1;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    if _InsideBox( ix, iy ) then
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 1 )
    else
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 0 );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.Proc.ClearSel( True );



// Automated test of SelectionMask - 8bit - Typical Values
// Edit the Selection Mask (8bit) and discard red and green channels
ImageEnView1.SelectionMaskDepth := 8;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    q := Round( iy / ImageEnView1.IEBitmap.Height * 255 );
    ImageEnView1.SelectionMask.SetPixel( ix, iy, q );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.Proc.Proc.DisposeChannels( 'B00' );



// Automated test of SelectionMask - 8bit - Alpha Channel - Typical Values
// Edit the Selection Mask (8bit) and discard red and green channels
ImageEnView1.SelectionMaskDepth := 8;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    q := Round( iy / ImageEnView1.IEBitmap.Height * 255 );
    ImageEnView1.SelectionMask.SetPixel( ix, iy, q );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.Proc.Proc.DisposeChannels( 'B00' );



// Automated test of SelectionMask - 8bit - 32-Bit RGBA - Typical Values
// Edit the Selection Mask (8bit) and discard red and green channels
ImageEnView1.SelectionMaskDepth := 8;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    q := Round( iy / ImageEnView1.IEBitmap.Height * 255 );
    ImageEnView1.SelectionMask.SetPixel( ix, iy, q );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.Proc.Proc.DisposeChannels( 'B00' );



// Automated test of SelectionMask - 8bit - 1-bit - Typical Values
// Edit the Selection Mask (8bit) and clear
ImageEnView1.SelectionMaskDepth := 8;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    q := Round( iy / ImageEnView1.IEBitmap.Height * 255 );
    ImageEnView1.SelectionMask.SetPixel( ix, iy, q );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.Proc.ClearSel( True );



// Automated test of SelectionMask - 1bit - Random Values
// Edit the Selection Mask (1bit) and colorize (Sepia)
ImageEnView1.SelectionMaskDepth := 1;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    if _InsideBox( ix, iy ) then
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 1 )
    else
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 0 );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 15 );
ImageEnView1.Proc.Colorize( 34, 50, 1.10 );



// Automated test of SelectionMask - 1bit - Alpha Channel - Random Values
// Edit the Selection Mask (1bit) and colorize (Sepia)
ImageEnView1.SelectionMaskDepth := 1;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    if _InsideBox( ix, iy ) then
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 1 )
    else
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 0 );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 15 );
ImageEnView1.Proc.Colorize( 34, 50, 1.10 );



// Automated test of SelectionMask - 1bit - 32-Bit RGBA - Random Values
// Edit the Selection Mask (1bit) and colorize (Sepia)
ImageEnView1.SelectionMaskDepth := 1;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    if _InsideBox( ix, iy ) then
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 1 )
    else
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 0 );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 15 );
ImageEnView1.Proc.Colorize( 34, 50, 1.10 );



// Automated test of SelectionMask - 1bit - 1-bit - Random Values
// Edit the Selection Mask (1bit) and clear
ImageEnView1.SelectionMaskDepth := 1;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    if _InsideBox( ix, iy ) then
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 1 )
    else
      ImageEnView1.SelectionMask.SetPixel( ix, iy, 0 );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 15 );
ImageEnView1.Proc.ClearSel( True );



// Automated test of SelectionMask - 8bit - Random Values
// Edit the Selection Mask (8bit) and colorize (Sepia)
ImageEnView1.SelectionMaskDepth := 8;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    q := Round( iy / ImageEnView1.IEBitmap.Height * 255 );
    ImageEnView1.SelectionMask.SetPixel( ix, iy, q );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.InvertSelection( True );
ImageEnView1.Proc.Colorize( 34, 50, 1.10 );



// Automated test of SelectionMask - 8bit - Alpha Channel - Random Values
// Edit the Selection Mask (8bit) and colorize (Sepia)
ImageEnView1.SelectionMaskDepth := 8;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    q := Round( iy / ImageEnView1.IEBitmap.Height * 255 );
    ImageEnView1.SelectionMask.SetPixel( ix, iy, q );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.InvertSelection( True );
ImageEnView1.Proc.Colorize( 34, 50, 1.10 );



// Automated test of SelectionMask - 8bit - 32-Bit RGBA - Random Values
// Edit the Selection Mask (8bit) and colorize (Sepia)
ImageEnView1.SelectionMaskDepth := 8;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    q := Round( iy / ImageEnView1.IEBitmap.Height * 255 );
    ImageEnView1.SelectionMask.SetPixel( ix, iy, q );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.InvertSelection( True );
ImageEnView1.Proc.Colorize( 34, 50, 1.10 );



// Automated test of SelectionMask - 8bit - 1-bit - Random Values
// Edit the Selection Mask (8bit) and clear
ImageEnView1.SelectionMaskDepth := 8;
for iy := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for ix := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    q := Round( iy / ImageEnView1.IEBitmap.Height * 255 );
    ImageEnView1.SelectionMask.SetPixel( ix, iy, q );
  end;
ImageEnView1.SelectCustom();
ImageEnView1.InvertSelection( True );
ImageEnView1.Proc.ClearSel( True );