示例#1
0
        public Cover(ImageInfo info, int coverPos, int currentPos, ModelVisual3D model)
        {
            pos = coverPos;
            imageName = new FileInfo(info.Path).Name;
            visualModel = model;

            imageSource = LoadImageSource(info);
            modelGroup = new Model3DGroup();
            modelGroup.Children.Add(new GeometryModel3D(Tessellate(), LoadImage(imageSource)));
            modelGroup.Children.Add(new GeometryModel3D(TessellateMirror(), LoadImageMirror(imageSource)));

            rotation = new AxisAngleRotation3D(new Vector3D(0, 1, 0), RotationAngle(currentPos));
            translation = new TranslateTransform3D(TranslationX(currentPos), 0, TranslationZ(currentPos));
            var transformGroup = new Transform3DGroup();
            transformGroup.Children.Add(new RotateTransform3D(rotation));
            transformGroup.Children.Add(translation);
            modelGroup.Transform = transformGroup;

            Content = modelGroup;

            visualModel.Children.Add(this);
        }
示例#2
0
 private void Add(ImageInfo info)
 {
     imageList.Add(imageList.Count, info);
     UpdateRange(index);
 }
示例#3
0
 private static ImageSource LoadImageSource(ImageInfo info)
 {
     if (thumbCache == null)
         throw new InvalidOperationException("No thumbnail cache.");
     return thumbCache.GetThumbnail(info.Host, info.Path);
 }