Code quality changes, and added the possibility to set the amount of colors for the Quantizer.

This commit is contained in:
RKrom 2014-05-11 11:23:56 +02:00
parent 3b1560390b
commit 77a92d98c3
92 changed files with 690 additions and 653 deletions

View file

@ -31,7 +31,7 @@ namespace Greenshot.Drawing {
/// <summary>
/// Description of CursorContainer.
/// </summary>
[Serializable()]
[Serializable]
public class CursorContainer : DrawableContainer, ICursorContainer {
private static ILog LOG = LogManager.GetLogger(typeof(CursorContainer));
@ -73,22 +73,24 @@ namespace Greenshot.Drawing {
}
public void Load(string filename) {
if (File.Exists(filename)) {
using (Cursor fileCursor = new Cursor(filename)) {
Cursor = fileCursor;
LOG.Debug("Loaded file: " + filename + " with resolution: " + Height + "," + Width);
}
if (!File.Exists(filename)) {
return;
}
using (Cursor fileCursor = new Cursor(filename)) {
Cursor = fileCursor;
LOG.Debug("Loaded file: " + filename + " with resolution: " + Height + "," + Width);
}
}
public override void Draw(Graphics graphics, RenderMode rm) {
if (cursor != null) {
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
graphics.CompositingQuality = CompositingQuality.Default;
graphics.PixelOffsetMode = PixelOffsetMode.None;
cursor.DrawStretched(graphics, Bounds);
if (cursor == null) {
return;
}
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
graphics.CompositingQuality = CompositingQuality.Default;
graphics.PixelOffsetMode = PixelOffsetMode.None;
cursor.DrawStretched(graphics, Bounds);
}
public override Size DefaultSize {