public void ReplaceWith( Stream imageStream )
Public Sub ReplaceWith ( imageStream As Stream )
This method replaces all occurrences of the image within the document. If the original image was used on several pages, then the new image will be used in the same places of the same pages.
The stream should contain a complete image encoded with one of the supported image compression schemes. This method won't work with only raster bytes or any other partial contents.
This method throws UnsupportedImageException when used on an inline image. You can check IsInline property before invoking this method.
Replacing an image can cause unexpected and/or unpleasant visual results. For example, image masking effects can be broken if you replace a mask image or an image that has a mask. Usually, it is undesirable to replace an image with a new image that has very different size and/or proportions.