2014-07-18 3 views
2

.NET 코딩에 익숙하지 않습니다.DZI를 만들기 위해 DeepZoomTools.dll을 사용하는 방법을 알아야합니다.

그러나 공유 서버에 DZI 슬라이스 이미지 자산을 만들어야하며 DeepZoomTools.dll을 인스턴스화하고 사용할 수 있다고 말했습니다.

누군가 적절한 .NET 코딩 기술을 보여주는 매우 간단한 DZI 생성 스크립트를 보여줄 수 있습니까? 필요에 따라 꾸미기도하지만 어디서부터 시작해야할지 모르겠다.

jpg가 있다고 가정하면 스크립트가 어떻게 간단하게 잘라서 저장합니까?

단지 몇 줄의 코드 일 것입니다. 서버가 IIS 7.5를 실행 중입니다.

누구나 간단한 예가 있으면 가장 감사하게 생각합니다.

감사

답변

0

예. "clsCanvas"개체와 컬렉션은 무시할 수 있습니다. GDI +를 사용하여 이미지를 생성하는 코드 내부의 개체로 디스크에 저장하는 개체였습니다. 아래의 코드는 파일에서 많은 이미지를 가져 와서 줌 가능한 컬렉션으로 어셈블하는 방법을 보여줍니다. 희망이 도움이 누군가 :-).

CollectionCreator cc = new CollectionCreator(); 

      // set default values that make sense for conversion options 
      cc.ServerFormat = ServerFormats.Default; 
      cc.TileFormat = ImageFormat.Jpg; 
      cc.TileSize = 256; 
      cc.ImageQuality = 0.92; 
      cc.TileOverlap = 0; 

      // the max level should always correspond to the log base 2 of the tilesize, unless otherwise specified 
      cc.MaxLevel = (int)Math.Log(cc.TileSize, 2); 

      List<Microsoft.DeepZoomTools.Image> aoImages = new List<Microsoft.DeepZoomTools.Image>(); 

      double fLeftShift = 0; 
      foreach (clsCanvas oCanvas in aoCanvases) 
      { 

       //viewport width as a function of this canvas, so the width of this canvas is 1 
       double fThisImgWidth = oCanvas.MyImageWidth - 1; //the -1 creates a 1px overlap, hides the seam between images. 
       double fTotalViewportWidth = fTotalImageWidth/fThisImgWidth; 
       double fMyLeftEdgeInViewportUnits = -fLeftShift/fThisImgWidth; ; //please don't ask me why this is a negative numeber 
       double fMyTopInViewportUnits = -fTotalViewportWidth * 0.3; 
       fLeftShift += fThisImgWidth; 

       Microsoft.DeepZoomTools.Image oImg = new Microsoft.DeepZoomTools.Image(oCanvas.MyFileName.Replace("_Out_Tile","")); 
       oImg.ViewportWidth = fTotalViewportWidth; 
       oImg.ViewportOrigin = new System.Windows.Point(fMyLeftEdgeInViewportUnits, fMyTopInViewportUnits); 

       aoImages.Add(oImg); 
      } 

      // create a list of all the images to include in the collection 
      cc.Create(aoImages, sMasterOutFile); 
관련 문제