$PBExportHeader$uo_fileview_pic.sru forward global type uo_fileview_pic from uo_fileview end type type p_1 from picture within uo_fileview_pic end type end forward global type uo_fileview_pic from uo_fileview integer width = 2738 integer height = 1680 long ii_screenwidth = 49925880 event resize pbm_size p_1 p_1 end type global uo_fileview_pic uo_fileview_pic forward prototypes public function integer of_showfile (blob arg_data, string arg_filename, ref string arg_msg) public subroutine of_setfilesize () end prototypes event resize;THIS.p_1.X = 0 THIS.p_1.Y = 0 IF NOT OriginalSize THEN THIS.p_1.Width = THIS.Width THIS.p_1.Height = THIS.Height END IF //this.of_setfilesize( ) end event public function integer of_showfile (blob arg_data, string arg_filename, ref string arg_msg);Long rslt = 1 cur_data = arg_data cur_filename = arg_Filename //of_setfilesize() RETURN rslt end function public subroutine of_setfilesize ();This.p_1.OriginalSize = OriginalSize //messagebox('','') This.HScrollBar = False This.VScrollBar = False IF IsNull(cur_data) THEN p_1.SetPicture(cur_data) RETURN END IF IF Len(cur_data) <= 0 THEN Blob nulldata SetNull(nulldata) p_1.SetPicture(nulldata) RETURN END IF p_1.PictureName = cur_Filename TRY blob filedata filedata =cur_data p_1.SetPicture(filedata) Catch(runtimeerror err) MessageBox('系统提示','获取文件失败,可能不支持该文件类型,~n'+err.Text) RETURN END TRY IF Not p_1.OriginalSize THEN This.HScrollBar = False This.VScrollBar = False This.p_1.Width = This.Width This.p_1.Height = This.Height p_1.X = 0 p_1.Y = 0 ELSE Long li_SW,li_SH Long li_x = 0,li_y = 0 IF p_1.Width > This.Width THEN This.HScrollBar = True li_x = 0 ELSE li_x = (This.Width - p_1.Width)/2 END IF IF p_1.Height > This.Height THEN This.VScrollBar = True li_y = 0 ELSE li_y = (This.Height - p_1.Height)/2 END IF p_1.Move( li_x,li_y) END IF end subroutine on uo_fileview_pic.create int iCurrent call super::create this.p_1=create p_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.p_1 end on on uo_fileview_pic.destroy call super::destroy destroy(this.p_1) end on type p_1 from picture within uo_fileview_pic integer width = 2359 integer height = 1416 boolean originalsize = true boolean focusrectangle = false end type