mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Code quality changes, and added the possibility to set the amount of colors for the Quantizer.
This commit is contained in:
parent
3b1560390b
commit
77a92d98c3
92 changed files with 690 additions and 653 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue