ImageEn

TIEMask.Assign Code Samples


Code samples for Assign.
Automatically generated by the Every Method demo.
// Automated test of SelectionMask - Text - Typical Values
// Assign an image (with text) to the selection mask and adjust levels
// Create an all black image (= Unselected)
bmp := TIEBitmap.Create( ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height, clBlack );

// Specify the font color, where white will be fully selected, whereas a gray color would be partially selected
bmp.IECanvas.Font.Color := TRGB2TColor( CreateRGB( 255, 255, 255 ));
bmp.IECanvas.Font.Size := 9;
bmp.IECanvas.Font.Style := [fsBold];

tw := bmp.IECanvas.TextWidth( ImageEn! );
th := bmp.IECanvas.TextHeight( ImageEn! );
x := ( ImageEnView1.IEBitmap.Width - tw ) div 2;
y := ( ImageEnView1.IEBitmap.Height - th ) div 2;
bmp.IECanvas.DrawText( ImageEn!, x, y );

ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.Proc.AdjustLevels( 0, 115, 255, 0, 255 );



// Automated test of SelectionMask - Text - Alpha Channel - Typical Values
// Assign an image (with text) to the selection mask and adjust levels
// Create an all black image (= Unselected)
bmp := TIEBitmap.Create( ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height, clBlack );

// Specify the font color, where white will be fully selected, whereas a gray color would be partially selected
bmp.IECanvas.Font.Color := TRGB2TColor( CreateRGB( 255, 255, 255 ));
bmp.IECanvas.Font.Size := 9;
bmp.IECanvas.Font.Style := [fsBold];

tw := bmp.IECanvas.TextWidth( ImageEn! );
th := bmp.IECanvas.TextHeight( ImageEn! );
x := ( ImageEnView1.IEBitmap.Width - tw ) div 2;
y := ( ImageEnView1.IEBitmap.Height - th ) div 2;
bmp.IECanvas.DrawText( ImageEn!, x, y );

ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.Proc.AdjustLevels( 0, 115, 255, 0, 255 );



// Automated test of SelectionMask - Text - 32-Bit RGBA - Typical Values
// Assign an image (with text) to the selection mask and adjust levels
// Create an all black image (= Unselected)
bmp := TIEBitmap.Create( ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height, clBlack );

// Specify the font color, where white will be fully selected, whereas a gray color would be partially selected
bmp.IECanvas.Font.Color := TRGB2TColor( CreateRGB( 255, 255, 255 ));
bmp.IECanvas.Font.Size := 9;
bmp.IECanvas.Font.Style := [fsBold];

tw := bmp.IECanvas.TextWidth( ImageEn! );
th := bmp.IECanvas.TextHeight( ImageEn! );
x := ( ImageEnView1.IEBitmap.Width - tw ) div 2;
y := ( ImageEnView1.IEBitmap.Height - th ) div 2;
bmp.IECanvas.DrawText( ImageEn!, x, y );

ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.Proc.AdjustLevels( 0, 115, 255, 0, 255 );



// Automated test of SelectionMask - Text - 1-bit - Typical Values
// Assign an image (with text) to the selection mask and clear
// Create an all black image (= Unselected)
bmp := TIEBitmap.Create( ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height, clBlack );

// Specify the font color, where white will be fully selected, whereas a gray color would be partially selected
bmp.IECanvas.Font.Color := TRGB2TColor( CreateRGB( 255, 255, 255 ));
bmp.IECanvas.Font.Size := 9;
bmp.IECanvas.Font.Style := [fsBold];

tw := bmp.IECanvas.TextWidth( ImageEn! );
th := bmp.IECanvas.TextHeight( ImageEn! );
x := ( ImageEnView1.IEBitmap.Width - tw ) div 2;
y := ( ImageEnView1.IEBitmap.Height - th ) div 2;
bmp.IECanvas.DrawText( ImageEn!, x, y );

ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.Proc.ClearSel( True );



// Automated test of SelectionMask - Image - Typical Values
// Assign an image to the selection mask and fill with white
bmp := TIEBitmap.Create();
bmp.Assign( ImageEnView1.IEBitmap );
IEConvertToBWThreshold( bmp, -1, False );
ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.Proc.Fill( clWhite );



// Automated test of SelectionMask - Image - Alpha Channel - Typical Values
// Assign an image to the selection mask and fill with white
bmp := TIEBitmap.Create();
bmp.Assign( ImageEnView1.IEBitmap );
IEConvertToBWThreshold( bmp, -1, False );
ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.Proc.Fill( clWhite );



// Automated test of SelectionMask - Image - 32-Bit RGBA - Typical Values
// Assign an image to the selection mask and fill with white
bmp := TIEBitmap.Create();
bmp.Assign( ImageEnView1.IEBitmap );
IEConvertToBWThreshold( bmp, -1, False );
ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.Proc.Fill( clWhite );



// Automated test of SelectionMask - Image - 1-bit - Typical Values
// Assign an image to the selection mask and clear
bmp := TIEBitmap.Create();
bmp.Assign( ImageEnView1.IEBitmap );
IEConvertToBWThreshold( bmp, -1, False );
ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.Proc.ClearSel( True );



// Automated test of SelectionMask - Text - Random Values
// Assign an image (with text) to the selection mask and adjust luminance
// Create an all black image (= Unselected)
bmp := TIEBitmap.Create( ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height, clBlack );

// Specify the font color, where white will be fully selected, whereas a gray color would be partially selected
bmp.IECanvas.Font.Color := TRGB2TColor( CreateRGB( 128, 128, 128 ));
bmp.IECanvas.Font.Size := 9;
bmp.IECanvas.Font.Style := [fsBold];

tw := bmp.IECanvas.TextWidth( ImageEn! );
th := bmp.IECanvas.TextHeight( ImageEn! );
x := ( ImageEnView1.IEBitmap.Width - tw ) div 2;
y := ( ImageEnView1.IEBitmap.Height - th ) div 2;
bmp.IECanvas.DrawText( ImageEn!, x, y );

ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 5 );
ImageEnView1.Proc.AdjustLumSatHistogram( 0.00, 0.85 );



// Automated test of SelectionMask - Text - Alpha Channel - Random Values
// Assign an image (with text) to the selection mask and adjust luminance
// Create an all black image (= Unselected)
bmp := TIEBitmap.Create( ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height, clBlack );

// Specify the font color, where white will be fully selected, whereas a gray color would be partially selected
bmp.IECanvas.Font.Color := TRGB2TColor( CreateRGB( 128, 128, 128 ));
bmp.IECanvas.Font.Size := 9;
bmp.IECanvas.Font.Style := [fsBold];

tw := bmp.IECanvas.TextWidth( ImageEn! );
th := bmp.IECanvas.TextHeight( ImageEn! );
x := ( ImageEnView1.IEBitmap.Width - tw ) div 2;
y := ( ImageEnView1.IEBitmap.Height - th ) div 2;
bmp.IECanvas.DrawText( ImageEn!, x, y );

ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 5 );
ImageEnView1.Proc.AdjustLumSatHistogram( 0.00, 0.85 );



// Automated test of SelectionMask - Text - 32-Bit RGBA - Random Values
// Assign an image (with text) to the selection mask and adjust luminance
// Create an all black image (= Unselected)
bmp := TIEBitmap.Create( ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height, clBlack );

// Specify the font color, where white will be fully selected, whereas a gray color would be partially selected
bmp.IECanvas.Font.Color := TRGB2TColor( CreateRGB( 128, 128, 128 ));
bmp.IECanvas.Font.Size := 9;
bmp.IECanvas.Font.Style := [fsBold];

tw := bmp.IECanvas.TextWidth( ImageEn! );
th := bmp.IECanvas.TextHeight( ImageEn! );
x := ( ImageEnView1.IEBitmap.Width - tw ) div 2;
y := ( ImageEnView1.IEBitmap.Height - th ) div 2;
bmp.IECanvas.DrawText( ImageEn!, x, y );

ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 5 );
ImageEnView1.Proc.AdjustLumSatHistogram( 0.00, 0.85 );



// Automated test of SelectionMask - Text - 1-bit - Random Values
// Assign an image (with text) to the selection mask and clear
// Create an all black image (= Unselected)
bmp := TIEBitmap.Create( ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height, clBlack );

// Specify the font color, where white will be fully selected, whereas a gray color would be partially selected
bmp.IECanvas.Font.Color := TRGB2TColor( CreateRGB( 128, 128, 128 ));
bmp.IECanvas.Font.Size := 9;
bmp.IECanvas.Font.Style := [fsBold];

tw := bmp.IECanvas.TextWidth( ImageEn! );
th := bmp.IECanvas.TextHeight( ImageEn! );
x := ( ImageEnView1.IEBitmap.Width - tw ) div 2;
y := ( ImageEnView1.IEBitmap.Height - th ) div 2;
bmp.IECanvas.DrawText( ImageEn!, x, y );

ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 5 );
ImageEnView1.Proc.ClearSel( True );



// Automated test of SelectionMask - Image - Random Values
// Assign an image to the selection mask and adjust levels
bmp := TIEBitmap.Create();
bmp.Assign( ImageEnView1.IEBitmap );
IEConvertToBWThreshold( bmp, 127, False );
ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 5 );
ImageEnView1.Proc.AdjustLevels( 0, 115, 255, 0, 255 );



// Automated test of SelectionMask - Image - Alpha Channel - Random Values
// Assign an image to the selection mask and adjust levels
bmp := TIEBitmap.Create();
bmp.Assign( ImageEnView1.IEBitmap );
IEConvertToBWThreshold( bmp, 127, False );
ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 5 );
ImageEnView1.Proc.AdjustLevels( 0, 115, 255, 0, 255 );



// Automated test of SelectionMask - Image - 32-Bit RGBA - Random Values
// Assign an image to the selection mask and adjust levels
bmp := TIEBitmap.Create();
bmp.Assign( ImageEnView1.IEBitmap );
IEConvertToBWThreshold( bmp, 127, False );
ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 5 );
ImageEnView1.Proc.AdjustLevels( 0, 115, 255, 0, 255 );



// Automated test of SelectionMask - Image - 1-bit - Random Values
// Assign an image to the selection mask and clear
bmp := TIEBitmap.Create();
bmp.Assign( ImageEnView1.IEBitmap );
IEConvertToBWThreshold( bmp, 127, False );
ImageEnView1.SelectionMask.Assign( bmp );
ImageEnView1.SelectCustom();
bmp.Free();
ImageEnView1.InvertSelection( True );
ImageEnView1.MakeSelectionFeather( 5 );
ImageEnView1.Proc.ClearSel( True );