# ReplaceImage Method

## Applies to

THtmlViewer component

## Declaration

procedure ReplaceImage(Const NameID: String; NewImage: TStream);

## Description

ReplaceImage will replace an existing image in the displayed document with a new image.

NameIdThe Name or ID attribute assigned in the relevant <img> tag.

NewImageThe new image in stream form. The image format (bmp, gif, etc.) may be in any format currently supported by THtmlViewer.

Usage Notes:

The replaced image will have the same position and size as the original image.

The NewImage stream is not freed by ReplaceImage. It may be freed imediately after the call.

## See Also:

MouseOver images