<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UpPic.ascx.cs" Inherits="TopWinCMS.WebUI.Admin.Window.UpPic1" %>
<%@ Register TagPrefix="ce" Namespace="CuteEditor" Assembly="CuteEditor" %>
<asp:Button ID="BT_openWindow" runat="server" CssClass="btn" Text="上传图片" OnClick="BT_openWindow_Click" />
<asp:Panel ID="Panel1" runat="server" Visible="false">
    <table border='0' cellspacing='0' cellpadding='0'>
        <tr>
            <td>
                <ce:Uploader ID="FileUploader1" OnFileUploaded="FileUploader1_FileUploaded" runat="server"
                    TempDirectory="~/UpLoadFolder" CancelText="取消" InsertText="上传" >
                    <ProgressPanelStyle Direction="NotSet" HorizontalAlign="NotSet" ScrollBars="None"
                        Wrap="True"></ProgressPanelStyle>
                   
                </ce:Uploader>
                
              </td>
        </tr>
    </table>
</asp:Panel>

<script language="javascript" type="text/javascript">
    var flag=false;
    function DrawImage(ImgD)
    {
	    var image=new Image();
	    image.src=ImgD.src;
	    if(image.width>0 && image.height>0)
	    {
		    flag=true;
		    if(image.width/image.height>= 120/80)
		    {
			    if(image.width>120)
			    {
				    ImgD.width=120;
				    ImgD.height=(image.height*120)/image.width;
			    }
			    else
			    {
				    ImgD.width=image.width;
				    ImgD.height=image.height;
			    }
			    ImgD.alt=image.width+"×"+image.height;
		    }
		    else{
			    if(image.height>80)
			    {
				    ImgD.height=80;
				    ImgD.width=(image.width*80)/image.height;
			    }
			    else
			    {
				    ImgD.width=image.width;
				    ImgD.height=image.height;
			    }
			    ImgD.alt=image.width+"×"+image.height;
		    }
	    }
    }

    function FileChange(Value)
    {
	    flag=false;
	    document.all.uploadimage.width=10;
	    document.all.uploadimage.height=10;
	    document.all.uploadimage.alt="";
	    document.all.uploadimage.src=Value;
    }
 
	function ClickRetrun( v )
	{
	    window.returnValue = v;
	    window.close();
	}
 
</script>

