4AspNet IPInfo v1.0

CountryInfo.GetFlagImageStream Method (Boolean)

Returns country flag image data.

public Stream GetFlagImageStream(
   bool useEmptyImage
);

Parameters

useEmptyImage
true to return the stream with empty (transparent) image if flag information is absent; false to return null reference (Nothing in Visual Basic).

Return Value

The Stream object.

Remarks

The returned Stream object contains sequence of bytes of the country flag thumbnail image. The format of an image is: PNG, 18x16 pixels. After obtaining this stream it is possible to save it's data to a file, write data to a response stream of a Web Forms, assign as an image for a PictureBox Windows Forms control or use data in some other way.

If flag information for a country is absent and useEmptyImage is set to true then the stream with empty (transparent) image is returned; if useEmptyImage is set to false the null reference (Nothing in Visual Basic) is returned.

Example

For an example see CountryInfo.GetFlagImageStream Overload List.

See Also

CountryInfo Class | ForAspNet.IPInfo Namespace | CountryInfo.GetFlagImageStream Overload List