Esempio n. 1
0
        public TimelineStory()
        {
            Opacity = 0;
            this.InitializeComponent();
            Loaded  += TimelineStory_Loaded;
            Loading += TimelineStory_Loading;

            DateContainer.Fade(duration: 0).StartAsync();
            TopLine.Fade(duration: 0).StartAsync();
            SummaryContainer.Fade(duration: 0).StartAsync();
            LikesContainer.Fade(duration: 0).StartAsync();
            ImageContainer.Scale(duration: 0,
                                 centerX: (float)ImageContainer.Width / 2,
                                 centerY: (float)ImageContainer.Height / 2,
                                 scaleX: 0.75f,
                                 scaleY: 0.75f).StartAsync();

            TitleLine.Scale(duration: 0,
                            scaleX: 0.6f,
                            scaleY: 0.6f)
            .Offset(offsetX: -30,
                    offsetY: 35,
                    duration: 0)
            .Fade(0.7f, duration: 0).StartAsync();
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> UpdateAvatar()
        {
            if (!Request.Content.IsMimeMultipartContent())
            {
                throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
            }

            try
            {
                ClaimsPrincipal oPrincipal  = (ClaimsPrincipal)Request.GetRequestContext().Principal;
                var             userId      = oPrincipal.Identity.GetUserId();
                var             userDetails = new UserDetails(userId);
                userDetails.ValidOrBreak();
                var root     = HttpContext.Current.Server.MapPath("~/App_Data");
                var provider = new MultipartFormDataStreamProvider(root);
                await Request.Content.ReadAsMultipartAsync(provider);

                var imageFile = ImageFactory.CreateFullImageModel("users", userDetails.PictureName, provider.FileData);
                ImageContainer.UploadImage(imageFile);

                return(Ok());
            }
            catch (InvalidModelException e)
            {
                return(BadRequest(e.Message));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Esempio n. 3
0
 public Rm_RaceDefinition()
 {
     ID          = Guid.NewGuid().ToString();
     Name        = "New Race";
     Description = "";
     Image       = new ImageContainer();
 }
Esempio n. 4
0
    private List <ImageContainer> MakeImageContainers()
    {
        List <ImageContainer> imageContainerList = new List <ImageContainer>();

        for (int i = 0; i < rows; i++)
        {
            for (int j = 0; j < columns; j++)
            {
                //look for walls or corners of same angle
                Tile tile = tileGrid[i][j];
                if (tile == null || tile.imageContainer != null)
                {
                    continue;
                }
                //depending on the angle, check the adjacent tiles
                Tile before = null;
                Tile after  = null;
                if (tile.floor.direction == Direction.East || tile.floor.direction == Direction.West)
                {
                    //check for tiles above and below

                    if (i > 0)
                    {
                        before = tileGrid[i - 1][j];
                    }
                    if (i < rows - 1)
                    {
                        after = tileGrid[i + 1][j];
                    }
                }
                else
                {
                    //check for tiles left and right
                    if (j > 0)
                    {
                        before = tileGrid[i][j - 1];
                    }
                    if (j < columns - 1)
                    {
                        after = tileGrid[i][j + 1];
                    }
                }
                if (before != null && before.imageContainer == null && FacingSameDirection(tile, before))
                {
                    ImageContainer imageContainer = new ImageContainer(before, tile);
                    before.imageContainer = imageContainer;
                    tile.imageContainer   = imageContainer;
                    imageContainerList.Add(imageContainer);
                }
                else if (after != null && after.imageContainer == null && FacingSameDirection(after, tile))
                {
                    ImageContainer imageContainer = new ImageContainer(tile, after);
                    after.imageContainer = imageContainer;
                    tile.imageContainer  = imageContainer;
                    imageContainerList.Add(imageContainer);
                }
            }
        }
        return(imageContainerList);
    }
Esempio n. 5
0
        private void Setup()
        {
            if (!_firstRun)
            {
                return;
            }
            _firstRun = false;

            var shadowContainer = ElementCompositionPreview.GetElementVisual(ImageContainer);
            var compositor      = shadowContainer.Compositor;

            var image       = ImageContainer.FindChildren <CompositionImage>().First();
            var imageVisual = image.SpriteVisual;

            var imageLoader      = ImageLoaderFactory.CreateImageLoader(compositor);
            var imageMaskSurface = imageLoader.CreateManagedSurfaceFromUri(new Uri("ms-appx:///Helpers/Composition/CircleMask.png"));

            var mask = compositor.CreateSurfaceBrush();

            mask.Surface = imageMaskSurface.Surface;

            var source = image.SurfaceBrush as CompositionSurfaceBrush;

            var maskBrush = compositor.CreateMaskBrush();

            maskBrush.Mask   = mask;
            maskBrush.Source = source;

            image.Brush = maskBrush;
            Shadow.Mask = maskBrush.Mask;

            this.Fade(value: 1, delay: 1000).StartAsync();
        }
        private void LoadFolder(object sender, RoutedEventArgs e)
        {
            string path = string.Empty;

            FolderBrowserDialog fb = new FolderBrowserDialog();

            if (fb.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    path = fb.SelectedPath;
                    images.Clear();
                    var files = Directory.GetFiles(path, "*.*").Where(s => s.EndsWith(".png") || s.EndsWith(".jpg") || s.EndsWith(".jpeg"));
                    foreach (string file in files)
                    {
                        string[]       filename = file.Split('\\');
                        ImageContainer image    = new ImageContainer
                        {
                            Name         = filename[filename.Length - 1],
                            ImageDetails = System.Drawing.Image.FromFile(file),
                            Image        = new BitmapImage(new Uri(file))
                        };
                        images.Add(image);
                    }
                }
                catch (Exception) { }
            }
        }
Esempio n. 7
0
        private async Task Render(IPipelineBlock block,
                                  ImageContainer container = ImageContainer.Destination,
                                  UndoRedoAction action    = UndoRedoAction.Undo)
        {
            View.SetCursor(CursorType.Wait);

            if (
                !_pipeline
                .Register(block
                          .Add <Bitmap>(
                              (bmp) => RenderBlock(bmp, container, action)
                              )
                          )
                )
            {
                throw new InvalidOperationException(Errors.Pipeline);
            }

            await _pipeline.AwaitResult().ConfigureAwait(true);

            if (container == ImageContainer.Source)
            {
                _cache.Reset();
            }

            if (!_pipeline.Any())
            {
                View.SetCursor(CursorType.Default);
            }
        }
Esempio n. 8
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            CanvasElements canvasElements = new CanvasElements
                                                (canvas, toolbar, commandBar, openHamburger, closeHamburger);

            if (e.Parameter is GroupsContent)
            {
                GroupsContent content = (GroupsContent)e.Parameter;

                // load group's stroke container
                canvas.InkPresenter.StrokeContainer = content.strokes;

                this.viewModel   = new CanvasPageViewModel(canvasElements, content);
                this.DataContext = viewModel;

                // set the background image if there is one
                if (content.backgroundPath != null)
                {
                    viewModel.setBackgroundImage(content.backgroundPath);
                }
                else if (content.imageContainer != null)
                {
                    ImageContainer ic = content.imageContainer;

                    viewModel.imageFilePath = ic.imagePath;
                    viewModel.ImageBitmap   = ic.image;

                    viewModel.xOffset   = ic.xOffset;
                    viewModel.yOffset   = ic.yOffset;
                    viewModel.newWidth  = ic.newWidth;
                    viewModel.newHeight = ic.newHeight;
                }
            }
        }
Esempio n. 9
0
        private static void CalculateHashedImageData(ImageContainer imageContainer, HashedImageData[,] hashedImageData, Size patternSize, Size regionSize)
        {
            List <Rectangle> regions = new List <Rectangle>();

            regions.Add(new Rectangle(Point.Empty, regionSize));
            CalculateHashedImageData(imageContainer, hashedImageData, patternSize, regions);
        }
Esempio n. 10
0
        public Rmh_Customise()
        {
            SaveInMenu        = true;
            SaveOnSceneSwitch = true;

            EnableExpGainedPopup    = true;
            EnableLevelReachedPopup = true;

            PersistGameObjectInfo    = true;
            SaveEnemyStatus          = true;
            SaveGameObjectPosition   = true;
            SaveGameObjectRotation   = true;
            SaveGameObjectDestroyed  = true;
            SaveGameObjectEnabled    = true;
            WorldMapLocations        = new List <WorldArea>();
            GameHasAchievements      = true;
            AchievementUnlockedSound = new AudioContainer();
            LoadingScreen            = new ImageContainer();

            TopDownHeight   = 10;
            TopDownDistance = 10;
            CameraXOffset   = 0;
            CameraYOffset   = 0;
            CameraZOffset   = 0;

            PressBothMouseButtonsToMove = true;
            RotateCameraWithPlayer      = true;
            EnableOrbitPlayer           = true;
            OrbitPlayerOption           = ClickOption.Left;
            EnableClickToRotate         = true;
            ClickToRotateOption         = ClickOption.Right;

            TooltipFollowsCursor = true;
        }
Esempio n. 11
0
    void Update()
    {
        if (RectTransformLerper.Lerpee == null)
        {
            return;
        }

        if (!ImageContainer.HasComponent <RectMask2D>())
        {
            ImageContainer.gameObject.AddComponent <RectMask2D>();
        }

        if (ToolImageA.sprite != Image.sprite)
        {
            ToolImageA.sprite = ToolImageB.sprite =
                Image.sprite;

            RectTransformLerper.A.sizeDelta = RectTransformLerper.B.sizeDelta =
                RectTransformLerper.Lerpee.sizeDelta;
        }

        RectTransformLerper.LerpFactor =
            (ImageContainer.rect.width - ToolAContainer.rect.width) /
            (ToolBContainer.rect.width - ToolAContainer.rect.width);
    }
Esempio n. 12
0
        public static List <string> ResolveImageProfile(ImageContainer container, int width, int height)
        {
            List <string> valuesProfiles = new List <string>();

            if (container == ImageContainer.Jpeg)
            {
                valuesProfiles.Add("JPEG");
            }
            else if (container == ImageContainer.Png)
            {
                valuesProfiles.Add("PNG");
            }
            else if (container == ImageContainer.Gif)
            {
                valuesProfiles.Add("GIF");
            }
            else if (container == ImageContainer.Raw)
            {
                valuesProfiles.Add("RAW");
            }
            else
            {
                throw new Exception("Image does not match any supported web profile");
            }
            return(valuesProfiles);
        }
 public MetaDataValue()
 {
     ID          = Guid.NewGuid().ToString();
     Name        = "New Metadata Value";
     Description = "";
     Image       = new ImageContainer();
 }
Esempio n. 14
0
    public ImageContainer PopImageContainers(int n)
    {
        ImageContainer t          = top;
        ImageContainer popStart   = null;
        ImageContainer lastPopped = null;
        int            i          = 0;

        while (t != null && i++ < n)
        {
            if (lastPopped == null)
            {
                popStart = t;
            }
            lastPopped = t;
            //they are already linked so ne need to link them again
            //just move the top down
            top = top.getNext();
            //reduce the total perimeter in the image bank
            this.perimeter -= t.getWidth();
            this.totalContainers--;
            t = t.getNext();
        }
        if (lastPopped != null)
        {
            lastPopped.setNext(null);            //to terminate the list
        }
        return(popStart);
    }
        private void LoadImagesFromTree(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            NoFileSelected.Visibility = Visibility.Visible;
            ImageInfo.Visibility      = Visibility.Collapsed;
            try
            {
                if (e.NewValue == null)
                {
                    return;
                }
                TreeViewItem directory = (TreeViewItem)e.NewValue;
                string       path      = directory.Tag as string;
                images.Clear();

                var files = Directory.GetFiles(path, "*.*").Where(s => s.ToLower().EndsWith(".png") || s.ToLower().EndsWith(".jpg") || s.ToLower().EndsWith(".jpeg"));
                foreach (string file in files)
                {
                    string[]       filename = file.Split('\\');
                    ImageContainer image    = new ImageContainer
                    {
                        Name         = filename[filename.Length - 1],
                        ImageDetails = System.Drawing.Image.FromFile(file),
                        Image        = new BitmapImage(new Uri(file)),
                        Size         = (new FileInfo(file).Length / 1024).ToString() + " KB"
                    };

                    images.Add(image);
                }
            }
            catch (Exception) { }
        }
Esempio n. 16
0
    private int MakeImageContainerListAndComputePerimeter(Album album)
    {
        int total = 0;
//		ImageContainer top=null;
        ImageContainer last = null;

        this.perimeter = 0;
        for (int i = 0; i < album.photoList.Length; i++)
        {
            Photo          photo            = album.photoList[i];
            double         normalizedWidth  = (photo.width / this.largestWidthOfAPhoto) * maxWidth;
            double         normalizedHeight = (photo.width / this.largestHeightOfAPhoto) * maxHeight;
            ImageContainer imageContainer   = new ImageContainer(photo, normalizedWidth, normalizedHeight);

            if (last == null)
            {
                top = imageContainer;
            }
            else
            {
                last.setNext(imageContainer);
            }
            last = imageContainer;
            total++;
            this.perimeter += imageContainer.getWidth();
        }
        return(total);
    }
        private void load(TextureStore textures, APIController api, Storage store)
        {
            ProjectName.Text               = onlineProject.Name;
            ProjectDescription.Text        = onlineProject.Description;
            ImageContainer.Add(loadingIcon = new SpriteIcon
            {
                Size             = new Vector2(.7f),
                RelativeSizeAxes = Axes.Both,
                FillMode         = FillMode.Fit,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Icon             = FontAwesome.Solid.Spinner,
            });
            Schedule(async() =>  //ToDo: ????
            {
                var texture = await textures.GetAsync(@$ "https://gamestogo.company/api/Games/DownloadFile/{onlineProject.Image}");

                Schedule(() =>
                {
                    ProjectImage.Texture = texture;
                    loadingIcon.FadeOut();
                });
            });

            BottomContainer.Add(new SpriteText
            {
                Font = new FontUsage(size: SMALL_TEXT_SIZE),
                Text = @"Este juego ya fue publicado!",
            });

            var userRequest = new GetUserRequest(onlineProject.Creator.ID);

            userRequest.Success += user => UsernameBox.Text = @$ "De {user.Username} (Ultima vez editado {onlineProject.DateTimeLastEdited:dd/MM/yyyy HH:mm})";
            api.Queue(userRequest);
        }
        public void emptyListTest()
        {
            ImageContainer image_container = new ImageContainer();
            List <Image>   list_img        = image_container.GetImages();

            Assert.AreEqual(0, list_img.Count);
        }
Esempio n. 19
0
        private List <string> GetFiles(ImageContainer container, SearchOption searchLevel)
        {
            if (!container.IsEnabled)
            {
                return(new List <string>());
            }
            var applicationConfig = _configurationAccessor.GetApplicationConfiguration();

            if (container.Genre == ImageGenre.Liked || container.Genre == ImageGenre.Disliked)
            {
                return(File.ReadAllLines(container.Path)
                       .Where(f => f.StartsWith("http") && container.Source == ImageSource.Remote)
                       .ToList());
            }

            if (container.Source == ImageSource.Local)
            {
                var folderPath = container.Path;
                return(Directory.GetFiles(folderPath, "*.*", searchLevel).ToList());
            }

            var urlFileDir = _pathsAccessor.GetSystemImages()
                             + Path.DirectorySeparatorChar + "URL Files"
                             + Path.DirectorySeparatorChar + container.Path;

            return(File.ReadAllLines(urlFileDir).ToList());
        }
Esempio n. 20
0
        protected virtual ImageContainer CreateImageContainer(string url)
        {
            var converter = new ImageContainer(url);

            converter.OnLoadComplete += d => d.FadeInFromZero(300, Easing.OutQuint);
            return(converter);
        }
Esempio n. 21
0
    public ImageContainer PopAll()
    {
        ImageContainer entireList = top;

        top             = null;
        totalContainers = 0;
        return(entireList);
    }
 public Rm_SubRaceDefinition()
 {
     ID               = Guid.NewGuid().ToString();
     Name             = "New Sub-Race";
     ApplicableRaceID = "";
     Description      = "";
     Image            = new ImageContainer();
 }
Esempio n. 23
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext     = this;
     _wordHelper     = new WordHelper();
     _imageContainer = new ImageContainer();
     _listImg        = new List <ImageSource>();
 }
Esempio n. 24
0
        private void CreateNewContainer(string initFileName)
        {
            ImageContainer container = new ImageContainer(initFileName);

            ImageContainers.Add(container);
            container.Focus();
            CurrentImageContainer = container;
            CurrentImageContainer.Image.ApplyOperation(ImageOperations.OperationList.Original, null);
        }
Esempio n. 25
0
 private void Animation_Completed(object sender, EventArgs e)
 {
     if (Canvas.GetLeft(ImageContainer) <= canvas.ActualWidth * -1 * (ImageContainer.Children.Count - 1))
     {
         ImageContainer.BeginAnimation(Canvas.LeftProperty, null);
         Canvas.SetLeft(ImageContainer, 0);
     }
     animationCompleteFlag = true;
 }
Esempio n. 26
0
 public void Setup()
 {
     foreach (var(path, index) in paths.WithIndex())
     {
         Bitmap bitmap = new Bitmap(path);
         ImageContainers[index] = new ImageContainer(bitmap, Path.GetFileName(path), index);
     }
     backgroundWorker.WorkerReportsProgress = true;
 }
Esempio n. 27
0
        public SvgComponent(UGUIContext context, string tag = "svg") : base(context, tag)
        {
#if REACT_VECTOR_GRAPHICS
            Image           = ImageContainer.AddComponent <Unity.VectorGraphics.SVGImage>();
            Measurer.Sprite = Image.sprite;
#else
            Debug.LogWarning("Unity.VectorGraphics module is required to use SVG components");
#endif
        }
Esempio n. 28
0
 private void PaintBlock(Bitmap bmp, ImageContainer to)
 {
     lock (_scale)
     {
         var size = bmp.Size;
         View.SetImage(to, bmp);
         View.SetImageCenter(to, size);
         View.Refresh(to);
     }
 }
Esempio n. 29
0
 private static void CalculateHashedImageData(ImageContainer imageContainer, HashedImageData[,] hashedImageData, Size patternSize, List <Rectangle> regions)
 {
     foreach (Rectangle region in regions)
     {
         BitmapData bitmapData = imageContainer.Bitmap.LockBits(new Rectangle(Point.Empty, imageContainer.Bitmap.Size), ImageLockMode.ReadOnly, PixelFormat);
         CalculateRGBHSum(bitmapData, hashedImageData, patternSize, region);
         CalculateRGBVSum(bitmapData, hashedImageData, patternSize, region);
         CalculateRGBDiff(bitmapData, hashedImageData, patternSize, region);
         imageContainer.Bitmap.UnlockBits(bitmapData);
     }
 }
Esempio n. 30
0
 /// <summary>
 /// Returns ImageContainer for hIcon provided
 /// </summary>
 /// <param name="description">Object description, tag, under which the container will be stored in cache</param>
 /// <param name="unmanagedIcon">HICON you obtained after some unmanaged interactions. DestroyIcon() is NOT being
 /// called automatically</param>
 /// <returns>ImageContainer with ImageSource`s for the given hIcon</returns>
 public static ImageContainer GetImageContainerForIconSync(string description, IntPtr unmanagedIcon)
 {
     lock (Cache)
     {
         if (Cache.ContainsKey(description))
             return (ImageContainer)Cache[description];
         var container = new ImageContainer(unmanagedIcon);
         Cache.Add(description, container);
         return container;
     }
 }
Esempio n. 31
0
 private void Add(string filename, string title, int Width, int Height)
 {
     images[count]          = new ImageContainer();
     images[count].height   = Height;
     images[count].width    = Width;
     images[count].filename = filename;
     images[count].title    = title;
     images[count].id       = count + 1;
     images[count + 1]      = new ImageContainer();
     count++;
 }
        public FilterController(ModuleFilterUi view)
        {
            this.view = view;
            self = this;

            statProcessing = new ValueStatistics();
            dataSet = new ImageContainer { InputCount = 1 };
            BuiltinFilters.Load();

            SetupUi();
        }
        public BlendingController(ModuleBlendingUi view)
        {
            this.view = view;
            self = this;

            const float intervals = (ProgressMax - ProgressStart) / ProgressIncrement;
            progressIntervals = (int)Math.Ceiling(intervals) + 1;

            dataSet = new ImageContainer
            {
                ContainerFormat = PixelFormat.Format24bppRgb,
                InputCount = 2
            };

            statProcessing = new ValueStatistics();
            processingGuard = new ManualResetEvent(false);

            SetupUi();
        }
Esempio n. 34
0
 // Constructor
 protected ImageHandler(StorageProviderType storageProvider)
 {
     ImageContainer = new ImageContainer(storageProvider);
 }
Esempio n. 35
0
 private void Add(string filename, string title,int Width, int Height)
 {
     images[count] = new ImageContainer();
     images[count].height = Height;
     images[count].width = Width;
     images[count].filename = filename;
     images[count].title = title;
     images[count].id = count + 1;
     images[count + 1] = new ImageContainer();
     count++;
 }
Esempio n. 36
0
 /// <summary>
 /// Synchronous getter of an icon for PowerItem
 /// </summary>
 /// <param name="item">PowerItem we need icon extracted for</param>
 /// <param name="iconNeeded">type of icon needed - small or large</param>
 /// <returns>ImageContainer with ImageSources extracted. Can be null.</returns>
 public static ImageContainer GetImageContainerSync(PowerItem item, API.Shgfi iconNeeded)
 {
     Log.Raw("begin>>>>>>>>>>>>>>>", item.FriendlyName);
     //Checking if there's cached ImageContainer
     string resolvedArg, descr;
     try
     {
         resolvedArg = PowerItemTree.GetResolvedArgument(item);
         descr = GetObjectDescriptor(item, resolvedArg);
     }
     catch (IOException)
     {
         return null;
     }
     lock (Cache)
     {
         var container = (ImageContainer)(Cache.ContainsKey(descr) ? Cache[descr] : null);
         Log.Fmt("arg<={0}, descr<={1}, container<={2}", resolvedArg, descr,
                 (container != null ? "not " : "") + "null");
         if (container == null) //No cached instance
         {
             container = new ImageContainer(resolvedArg, descr, item.SpecialFolderId);
             Cache.Add(descr, container);
             if (iconNeeded == API.Shgfi.SMALLICON)
                 container.ExtractSmall();
             else
                 container.ExtractLarge();
         }
     #if DEBUG
         Log.Raw("end<<<<<<<<<<<<<<", item.FriendlyName);
     #endif
         return container;
     }
 }
Esempio n. 37
0
 void Awake()
 {
     instance = this;
 }
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //ImageContainerDelegate Methods
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 public void exportImage(ImageContainer imageContainer, ZArrayDescriptor arrayDescriptor)
 {
     setZArray(arrayDescriptor);
 }
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //Private Methods
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void addImageContainer()
        {
            ImageContainer newImageContainer = new ImageContainer();
            newImageContainer.myDelegate = this;
            newImageContainer.HorizontalAlignment = HorizontalAlignment.Stretch;
            newImageContainer.VerticalAlignment = VerticalAlignment.Stretch;
            newImageContainer.Width = Double.NaN;
            newImageContainer.Height = Double.NaN;
            newImageContainer.setImageNumberLabel(imageContainersList.Count + 1);

            RowDefinition newRowDefinition = new RowDefinition();
            scrollerContent.RowDefinitions.Add(newRowDefinition);
            scrollerContent.Children.Add(newImageContainer);
            Grid.SetRow(newImageContainer, imageContainersList.Count);
            imageContainersList.Add(newImageContainer);
        }
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 public ZArrayDescriptor getImageToLoad(ImageContainer imageContainer)
 {
     return zArrayDescriptor;
 }