Filling the abyss

<not implemented yet>

In several cases an abyss (see Figure 127) is created between an image and the rectangle that encloses the image.


The following code adds a blue abyss color to the image bundle. To keep the code concise, the code to create the image bundle and polygon is not shown.

    1  TRGBColor blueColor( 0, 0, .5 );
    2  TImageSamplingControl* imageSample = new TImageSamplingControl();
    3  imageSample->SetAbyssColor( blueColor );
    4  imageBundle->AdoptImageSampling( imageSample );
    5  
    6  TA8R8G8B8Image anRGBImage( TGPoint::kOrigin, 100, 100, imageBundle );
    7  TGrafPort* imagePort->anRGBImage.GetGrafPort();
    8  
    9  imagePort->Draw( TGRect( 0,0, 200,200) );
    10  aPolygon->Draw( *imagePort );
    11  
    12  anRGBImage.Draw( thePort );
Line 1: Create a blue abyss color.

Lines 2 through 3: Create a TImageSamplingControl with the default filtering method of kPointSampling. You get the default because no parameter is specified in the imageSample instantiation.

    Line 3: Set the abyss color to blue in imageSample.
Line 4: Adopt imageSample to imageBundle.

Lines 6 and 7: Create an image that is 100 world-coordinate units wide and high, and get the image port.

Lines 9: Draw a rectangle that is 200 world-coordinate units wide and high into the image port. Note that the image is smaller than the rectangle.

Line 10: Draw the polygon graphic into the image port.

Line 12: Draw the image. The area between the rectangle and the image fills with the blue abyss color.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker