mirror of
https://github.com/fadden/6502bench.git
synced 2025-07-01 10:24:06 +00:00
Fix proportions for animated GIFs
As with still images, animations are rendered at original size and then scaled with HTML properties. Also, fixed the blurry scaling on animation thumbnails. I couldn't find a way to do nearest-neighbor scaling in the code-behind without resorting to System.Drawing (WinForms), so I added an overlay image to the various grids.
This commit is contained in:
@ -72,6 +72,11 @@ namespace SourceGen {
|
||||
/// </remarks>
|
||||
public BitmapSource CachedImage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Image overlaid on CachedImage. Used to identify thumbnails as animations.
|
||||
/// </summary>
|
||||
public BitmapSource OverlayImage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// True if CachedImage has something other than the default value.
|
||||
/// </summary>
|
||||
@ -93,6 +98,8 @@ namespace SourceGen {
|
||||
internal static readonly BitmapSource ANIM_OVERLAY_IMAGE =
|
||||
VisualizationAnimation.GenerateAnimOverlayImage();
|
||||
|
||||
internal static readonly BitmapSource BLANK_IMAGE = GenerateBlankImage();
|
||||
|
||||
/// <summary>
|
||||
/// Serial number, for reference from other Visualization objects. Not serialized.
|
||||
/// </summary>
|
||||
@ -138,6 +145,7 @@ namespace SourceGen {
|
||||
VisGenIdent = visGenIdent;
|
||||
VisGenParams = visGenParams;
|
||||
CachedImage = BROKEN_IMAGE;
|
||||
OverlayImage = BLANK_IMAGE;
|
||||
|
||||
if (oldObj == null) {
|
||||
// not worried about multiple threads
|
||||
@ -210,6 +218,12 @@ namespace SourceGen {
|
||||
return image;
|
||||
}
|
||||
|
||||
private static BitmapSource GenerateBlankImage() {
|
||||
RenderTargetBitmap bmp = new RenderTargetBitmap(1, 1, 96.0, 96.0,
|
||||
PixelFormats.Pbgra32);
|
||||
return bmp;
|
||||
}
|
||||
|
||||
|
||||
public override string ToString() {
|
||||
return "[Vis: " + Tag + " (" + VisGenIdent + ") count=" + VisGenParams.Count + "]";
|
||||
|
Reference in New Issue
Block a user