forked from DotSpatial/DotSpatial
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- In InRamImageData.Open don't draw the image unscaled because this c…
…an cause the image not to be drawn - added corresponding test
- Loading branch information
1 parent
6e81b44
commit e181a34
Showing
5 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) DotSpatial Team. All rights reserved. | ||
// Licensed under the MIT license. See License.txt file in the project root for full license information. | ||
|
||
using System.Drawing; | ||
using System.IO; | ||
using NUnit.Framework; | ||
|
||
namespace DotSpatial.Data.Tests | ||
{ | ||
/// <summary> | ||
/// Contains tests for the InRamImageData class. | ||
/// </summary> | ||
[TestFixture] | ||
public class InRamImageDataTests | ||
{ | ||
/// <summary> | ||
/// This checks that the image that gets loaded in InRamImageData(fileName) ctor gets drawn to _inRamImage. | ||
/// </summary> | ||
[Test(Description = "This checks that the image that gets loaded in InRamImageData(fileName) constructor gets drawn to _inRamImage.")] | ||
public void InRamImageDataCtorLoadsImageWithColor() | ||
{ | ||
var imagePath = Path.Combine(@"Data\Grids", "Hintergrundkarte.tif"); | ||
|
||
using (var inram = new InRamImageData(imagePath)) | ||
using (var bitmap = inram.GetBitmap()) | ||
{ | ||
Assert.AreEqual(Color.FromArgb(255, 125, 105, 72), bitmap.GetPixel(300, 300)); // if the image was not drawn correctly GetPixel returns the ARGB values for white | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters