//Test image which we will determine the extents of.


<1>/* Graphics Not Rendered in HTML */


U0 Extents()
{
    CDC *dc = DCAlias;
    I64  min_x, max_x, min_y, max_y;

    //Screen, not win coordinates.
    I64 h = Fs->pix_left + Fs->scroll_x,  v = Fs->pix_top + Fs->scroll_y;

    DocClear;
    DCFill;

    //This sets a flag to record the
    //extents of what we draw and inits
    //the max's and min's.  Vals are
    //screen coordinates.
    DCExtentsInit(dc);

    dc->thick = 3;
    Sprite3(dc, 40, GR_HEIGHT >> 1, 0, <1>);

    dc->color = LTRED;
    dc->thick = 1;

    //This box is the extents.
    GrLine(dc, dc->min_x - h, dc->min_y - v, dc->max_x - h, dc->min_y - v);
    GrLine(dc, dc->min_x - h, dc->min_y - v, dc->min_x - h, dc->max_y - v);
    GrLine(dc, dc->max_x - h, dc->max_y - v, dc->max_x - h, dc->min_y - v);
    GrLine(dc, dc->max_x - h, dc->max_y - v, dc->min_x - h, dc->max_y - v);

    DCDel(dc);
    PressAKey;
    DCFill;

    SpriteExtents(<1>, &min_x, &max_x, &min_y, &max_y);
    "X: %d to %d\n", min_x, max_x;
    "Y: %d to %d\n", min_y, max_y;
}

Extents;