11using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Web ;
5- using System . Web . UI ;
6- using System . Web . UI . WebControls ;
72using OSAE ;
83
94public partial class controls_ctrlEmbedded : System . Web . UI . UserControl
105{
116 public OSAEObject screenObject { get ; set ; }
127 public string Source ;
138 public string width , height ;
9+ double imgRatio ;
10+ public double ControlWidth ;
11+ public double ControlHeight ;
12+ string streamURI ;
1413
1514 protected void Page_Load ( object sender , EventArgs e )
1615 {
1716 OSAEObject obj = OSAEObjectManager . GetObjectByName ( screenObject . Property ( "Object Name" ) . Value ) ;
18- Source = renameingSys ( obj . Property ( "Stream Address" ) . Value ) ;
19- width = screenObject . Property ( "Width" ) . Value ;
20- height = screenObject . Property ( "Height" ) . Value ;
21- frame . Attributes . Add ( "width" , width ) ;
22- frame . Attributes . Add ( "height" , height ) ;
23- frame . Attributes . Add ( "src" , Source ) ;
24- frame . Attributes . Add ( "Style" , "position:absolute;top:" + ( Int32 . Parse ( screenObject . Property ( "Y" ) . Value ) + 50 ) . ToString ( ) + "px;left:" + ( Int32 . Parse ( screenObject . Property ( "X" ) . Value ) + 10 ) . ToString ( ) + "px;z-index:" + ( Int32 . Parse ( screenObject . Property ( "ZOrder" ) . Value ) + 10 ) . ToString ( ) + ";" ) ;
25- }
17+ Source = renameingSys ( obj . Property ( "SNAP SHOT" ) . Value ) ;
18+ double imgWidth = Convert . ToDouble ( obj . Property ( "Width" ) . Value ) ;
19+ double imgHeight = Convert . ToDouble ( obj . Property ( "Height" ) . Value ) ;
20+ ControlWidth = Convert . ToDouble ( screenObject . Property ( "Width" ) . Value ) ;
21+ imgRatio = ControlWidth / imgWidth ;
22+ ControlHeight = Convert . ToInt32 ( imgHeight * imgRatio ) ;
23+ width = ControlWidth . ToString ( ) ;
24+ height = ControlHeight . ToString ( ) ;
25+ imgSnapShot . Attributes . Add ( "Style" , "position:absolute;top:" + ( Int32 . Parse ( screenObject . Property ( "Y" ) . Value ) + 50 ) . ToString ( ) + "px;left:" + ( Int32 . Parse ( screenObject . Property ( "X" ) . Value ) + 10 ) . ToString ( ) + "px;z-index:" + ( Int32 . Parse ( screenObject . Property ( "ZOrder" ) . Value ) + 10 ) . ToString ( ) + ";" ) ;
26+ imgSnapShot . ImageUrl = Source ;
27+ imgSnapShot . Width = System . Web . UI . WebControls . Unit . Parse ( width ) ;
28+ imgSnapShot . Height = System . Web . UI . WebControls . Unit . Parse ( height ) ;
29+ }
2630
2731 private string renameingSys ( string fieldData )
2832 {
@@ -35,9 +39,7 @@ private string renameingSys(string fieldData)
3539 string getProperty = OSAEObjectPropertyManager . GetObjectPropertyValue ( screenObject . Property ( "Object Name" ) . Value , renameProperty ) . Value ;
3640 // log any errors
3741 if ( getProperty . Length > 0 )
38- {
3942 newData = newData . Replace ( "[" + renameProperty + "]" , getProperty ) ;
40- }
4143 }
4244 newData = @"http://" + newData ;
4345 return newData ;
0 commit comments