| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 | 
							- using System;
 
- using System.Collections;
 
- using System.IO;
 
- using ET;
 
- using FairyGUI;
 
- using UI.DressUp;
 
- using UnityEngine;
 
- namespace GFGGame
 
- {
 
-     public class PhotographSaveView : BaseView
 
-     {
 
-         private UI_PhotographSaveUI _ui;
 
-         protected override void OnInit()
 
-         {
 
-             base.OnInit();
 
-             packageName = UI_PhotographUI.PACKAGE_NAME;
 
-             _ui = UI_PhotographSaveUI.Create();
 
-             viewCom = _ui.target;
 
-             isfullScreen = true;
 
-             _ui.m_btnClose.onClick.Add(this.Hide);
 
-             _ui.m_btnSave.onClick.Add(this.OnClickBtnSave);
 
-             _ui.m_btnSavePhoto.onClick.Add(this.OnClickBtnSavePhoto);
 
-         }
 
-         protected override void OnShown()
 
-         {
 
-             base.OnShown();
 
-             Texture2D tex = this.viewData as Texture2D;
 
-             _ui.m_imgRes.texture = new NTexture(tex);
 
-             float width = _ui.m_imgBorder.width;
 
-             float height = width * tex.height / tex.width;
 
-             _ui.m_imgRes.SetSize(width, height);
 
-             _ui.m_imgBorder.SetSize(width, height + 12);
 
-         }
 
-         protected override void OnHide()
 
-         {
 
-             base.OnHide();
 
-         }
 
-         public override void Dispose()
 
-         {
 
-             if (_ui != null)
 
-             {
 
-                 _ui.Dispose();
 
-                 _ui = null;
 
-             }
 
-             base.Dispose();
 
-         }
 
-         private void OnClickBtnSave()
 
-         {
 
-             Texture2D tex = this.viewData as Texture2D;
 
-             byte[] bytes = tex.EncodeToJPG();//将纹理数据,转化成一个jpg图片
 
-             string fileName = "wsj" + TimeHelper.ServerNowSecs + ".jpg";
 
-             PhotographDataManager.Instance.SavePicturoToLocal(bytes, fileName);
 
-         }
 
-         private async void OnClickBtnSavePhoto()
 
-         {
 
-             Texture2D tex = this.viewData as Texture2D;
 
-             byte[] bytes = tex.EncodeToJPG();//将纹理数据,转化成一个jpg图片
 
-             string[] rsp = await PoemPhotoSProxy.ReqTempPictureUrl((int)PictureType.jpg);
 
-             if (rsp == null) return;
 
-             string code = PoemPhotoSProxy.PushToHWCloud(rsp[0], bytes);
 
-             if (string.IsNullOrEmpty(code)) return;
 
-             PoemPhotoSProxy.ReqAddTophoto(rsp[1], (int)PictureSourceType.PersonalAlbum).Coroutine();
 
-         }
 
-     }
 
- }
 
 
  |