Improving tips system
removing gifs (added a meg of data) put in closer to real data
This commit is contained in:
parent
f445c28677
commit
44a8de8f4b
10 changed files with 167 additions and 24 deletions
|
|
@ -1429,7 +1429,6 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Download an image from the web into the specified ImageBuffer
|
||||
/// </summary>
|
||||
|
|
@ -1489,6 +1488,39 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download an image from the web into the specified ImageSequence
|
||||
/// </summary>
|
||||
/// <param name="uri"></param>
|
||||
public void DownloadToImageSequenceAsync(ImageSequence imageSequenceToLoadInto, string uriToLoad)
|
||||
{
|
||||
WebClient client = new WebClient();
|
||||
client.DownloadDataCompleted += (object sender, DownloadDataCompletedEventArgs e) =>
|
||||
{
|
||||
try // if we get a bad result we can get a target invocation exception. In that case just don't show anything
|
||||
{
|
||||
// scale the loaded image to the size of the target image
|
||||
byte[] raw = e.Result;
|
||||
Stream stream = new MemoryStream(raw);
|
||||
ImageBuffer unScaledImage = new ImageBuffer(10, 10);
|
||||
AggContext.StaticData.LoadImageSequenceData(stream, imageSequenceToLoadInto);
|
||||
|
||||
imageSequenceToLoadInto.Invalidate();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
client.DownloadDataAsync(new Uri(uriToLoad));
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cancels prints within the first two minutes or interactively prompts the user to confirm cancellation
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue