private void ProcessParameters()
{
type = Element.IMGTEMPLATE;
originalType = ORIGINAL_WMF;
Stream istr = null;
try {
string errorID;
if (rawData == null){
WebRequest w = WebRequest.Create(url);
w.Credentials = CredentialCache.DefaultCredentials;
istr = w.GetResponse().GetResponseStream();
errorID = url.ToString();
}
else{
istr = new MemoryStream(rawData);
errorID = "Byte array";
}
InputMeta im = new InputMeta(istr);
if (im.ReadInt() != unchecked((int)0x9AC6CDD7)) {
throw new BadElementException(MessageLocalization.GetComposedMessage("1.is.not.a.valid.placeable.windows.metafile", errorID));
}
im.ReadWord();
int left = im.ReadShort();
int top = im.ReadShort();
int right = im.ReadShort();
int bottom = im.ReadShort();
int inch = im.ReadWord();
dpiX = 72;
dpiY = 72;
scaledHeight = (float)(bottom - top) / inch * 72f;
this.Top =scaledHeight;
scaledWidth = (float)(right - left) / inch * 72f;
this.Right = scaledWidth;
}
finally {
if (istr != null) {
istr.Close();
}
plainWidth = this.Width;
plainHeight = this.Height;
}
}