public override Task <ThumbnailInfo> GetThumbnailInfoAsync(PostClass.StatusGeo geo) { var thumb = new ThumbnailInfo { MediaPageUrl = this.CreateMapLinkUrl(geo.Latitude, geo.Longitude), ThumbnailImageUrl = this.CreateStaticMapUrl(geo.Latitude, geo.Longitude), TooltipText = null, }; return(Task.FromResult(thumb)); }
public override Task<ThumbnailInfo> GetThumbnailInfoAsync(PostClass.StatusGeo geo) { var thumb = new ThumbnailInfo { MediaPageUrl = this.CreateMapLinkUrl(geo.Latitude, geo.Longitude), ThumbnailImageUrl = this.CreateStaticMapUrl(geo.Latitude, geo.Longitude), TooltipText = null, }; return Task.FromResult(thumb); }
public ThumbnailDoubleClickEventArgs(ThumbnailInfo thumbnail) { this.Thumbnail = thumbnail; }
private void OpenThumbnailPicture(ThumbnailInfo thumbnail) { this.OpenUriAsync(Uri.EscapeUriString(thumbnail.ImageUrl)); }
private async Task SetThumbnailImageAsync(OTPictureBox picbox, ThumbnailInfo thumbInfo, CancellationToken cancelToken) { try { picbox.ShowInitialImage(); picbox.MouseDown += this.pictureBox_MouseDown; picbox.MouseUp += this.pictureBox_MouseUp; picbox.Image = await thumbInfo.LoadThumbnailImageAsync(cancelToken); cancelToken.ThrowIfCancellationRequested(); picbox.MouseMove += this.pictureBox_MouseMove; if (this.ThumbnailLoadCompleted != null) this.ThumbnailLoadCompleted(picbox, EventArgs.Empty); } catch (Exception) { picbox.ShowErrorImage(); try { throw; } catch (HttpRequestException) { } catch (InvalidImageException) { } catch (TaskCanceledException) { } catch (WebException) { } } }
protected ThumbnailZoomWindow(MemoryImage thumbnail, ThumbnailInfo thumbInfo, Rectangle startupBounds, Point originPos) { this.startupBounds = startupBounds; this.originPos = originPos; using (ControlTransaction.Layout(this, false)) { this.DoubleBuffered = true; this.TopMost = true; this.FormBorderStyle = FormBorderStyle.None; this.ShowInTaskbar = false; this.StartPosition = FormStartPosition.Manual; this.Bounds = startupBounds; this.Capture = true; this.MouseMove += ThumbnailZoomWindow_MouseMove; this.MouseUp += ThumbnailZoomWindow_MouseUp; var picbox = new OTPictureBox() { Name = "picbox", Image = thumbnail, Tag = thumbInfo, SizeMode = PictureBoxSizeMode.Zoom, WaitOnLoad = false, Dock = DockStyle.Fill, }; this.Controls.Add(picbox); picbox.MouseMove += ThumbnailZoomWindow_MouseMove; picbox.MouseUp += ThumbnailZoomWindow_MouseUp; } }
private ContextMenu CreateContextMenu(ThumbnailInfo thumb) { var contextMenu = new ContextMenu(); contextMenu.MenuItems.Add(CreateImageSearchMenuItem(thumb)); return contextMenu; }
private MenuItem CreateImageSearchMenuItem(ThumbnailInfo thumb) { var item = new MenuItem(); item.Text = Properties.Resources.SearchSimilarImageText; string search_targe_url = thumb.FullSizeImageUrl != null ? thumb.FullSizeImageUrl : thumb.ThumbnailUrl != null ? thumb.ThumbnailUrl : null; if (search_targe_url != null) { item.Click += (sender, e) => { string uri = GetImageSearchUri(search_targe_url); if (this.ThumbnailImageSearchClick != null) { this.ThumbnailImageSearchClick(this, new ThumbnailImageSearchEventArgs(uri)); } }; } else { item.Enabled = false; } return item; }
private void OpenThumbnailPicture(ThumbnailInfo thumbnail) { this.OpenUriAsync(thumbnail.ImageUrl); }
private async Task SetThumbnailImageAsync(OTPictureBox picbox, ThumbnailInfo thumbInfo, CancellationToken cancelToken) { try { picbox.ShowInitialImage(); picbox.Image = await thumbInfo.LoadThumbnailImageAsync(cancelToken); } catch (Exception) { picbox.ShowErrorImage(); try { throw; } catch (HttpRequestException) { } catch (InvalidImageException) { } catch (TaskCanceledException) { } } }
private async Task OpenThumbnailPicture(ThumbnailInfo thumbnail) { var url = thumbnail.FullSizeImageUrl ?? thumbnail.ImageUrl; url = url.Replace(" ", "%20"); await this.OpenUriInBrowserAsync(url); }
private async Task OpenThumbnailPicture(ThumbnailInfo thumbnail) { var url = thumbnail.FullSizeImageUrl ?? thumbnail.MediaPageUrl; await this.OpenUriInBrowserAsync(url); }
private void OpenThumbnailPicture(ThumbnailInfo thumbnail) { string url = thumbnail.ImageUrl; url = url.Replace(" ", "%20"); this.OpenUriAsync(url); }