by nageswaragunupudi » Wed Jun 01, 2011 11:59 pm
This is the logic adopted:
nResizeMode is not relevant for solid and style brushes, but only to those which depend on bitmaps, including gradients.
Default mode for all bitmap brushes, except gradients, is TILED mode. nResizeMode = 0 is the default tiled mode. This is the traditional way. nResizeMode = 1 means STRETCH and nResizeMode = 2 means RESIZE. Optionally, one of these two modes can be selected in case of Images, at the time of creation of the brush. RESIZE mode retains the aspect ratio, while STRETCH does not. In case of RESIZE, one of the dimensions fits the window client size while the other may exceed.
Gradient brushes are always to be stretched, i.e., the entire window client area is to be filled. Size of the bitmap created is exactly the same as the client area of the window.
By default the gradient type is Vertical, which is represented by nResizeMode = 1 and optional HORIZONTAL mode is represented by 2. When a brush is created for gradient, we are setting the default to 1 ( vertical ) in the New() method, unless HORIZ clause is specified.
Hope this explains. Welcome your suggestions.
Regards
G. N. Rao.
Hyderabad, India