mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Fixed Window corner cut to skip tool windows, and use a cut shape from the configuration.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2300 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
2d767f735c
commit
57ebc0c675
2 changed files with 8 additions and 8 deletions
|
@ -203,6 +203,9 @@ namespace GreenshotPlugin.Core {
|
||||||
[IniProperty("EnableSpecialDIBClipboardReader", Description = "Enable a special DIB clipboard reader", DefaultValue="True")]
|
[IniProperty("EnableSpecialDIBClipboardReader", Description = "Enable a special DIB clipboard reader", DefaultValue="True")]
|
||||||
public bool EnableSpecialDIBClipboardReader;
|
public bool EnableSpecialDIBClipboardReader;
|
||||||
|
|
||||||
|
[IniProperty("WindowCornerCutShape", Description = "The cutshape which is used to remove the window corners, is mirrorred for all corners", DefaultValue = "5,3,2,1,1")]
|
||||||
|
public List<int> WindowCornerCutShape;
|
||||||
|
|
||||||
// Specifies what THIS build is
|
// Specifies what THIS build is
|
||||||
public BuildStates BuildState = BuildStates.UNSTABLE;
|
public BuildStates BuildState = BuildStates.UNSTABLE;
|
||||||
|
|
||||||
|
@ -222,9 +225,6 @@ namespace GreenshotPlugin.Core {
|
||||||
/// <returns>object with the default value for the supplied property</returns>
|
/// <returns>object with the default value for the supplied property</returns>
|
||||||
public override object GetDefault(string property) {
|
public override object GetDefault(string property) {
|
||||||
switch(property) {
|
switch(property) {
|
||||||
case "OutputPrintFooterPattern":
|
|
||||||
|
|
||||||
break;
|
|
||||||
case "PluginWhitelist":
|
case "PluginWhitelist":
|
||||||
case "PluginBacklist":
|
case "PluginBacklist":
|
||||||
return new List<string>();
|
return new List<string>();
|
||||||
|
|
|
@ -973,7 +973,8 @@ namespace GreenshotPlugin.Core {
|
||||||
if (capturedBitmap != null) {
|
if (capturedBitmap != null) {
|
||||||
// Not needed for Windows 8
|
// Not needed for Windows 8
|
||||||
if (!(Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor >= 2)) {
|
if (!(Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor >= 2)) {
|
||||||
if (conf.WindowCaptureRemoveCorners && !Maximised) {
|
// Only if the Inivalue is set, not maximized and it's not a tool window.
|
||||||
|
if (conf.WindowCaptureRemoveCorners && !Maximised && (this.ExtendedWindowStyle | ExtendedWindowStyleFlags.WS_EX_TOOLWINDOW) != 0) {
|
||||||
// Remove corners
|
// Remove corners
|
||||||
if (!Image.IsAlphaPixelFormat(capturedBitmap.PixelFormat)) {
|
if (!Image.IsAlphaPixelFormat(capturedBitmap.PixelFormat)) {
|
||||||
LOG.Debug("Changing pixelformat to Alpha for the RemoveCorners");
|
LOG.Debug("Changing pixelformat to Alpha for the RemoveCorners");
|
||||||
|
@ -1016,11 +1017,10 @@ namespace GreenshotPlugin.Core {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="image">The bitmap to remove the corners from.</param>
|
/// <param name="image">The bitmap to remove the corners from.</param>
|
||||||
private void RemoveCorners(Bitmap image) {
|
private void RemoveCorners(Bitmap image) {
|
||||||
int [] cornerRange = {5,3,2,1,1};
|
|
||||||
using (BitmapBuffer buffer = new BitmapBuffer((Bitmap)image, false)) {
|
using (BitmapBuffer buffer = new BitmapBuffer((Bitmap)image, false)) {
|
||||||
buffer.Lock();
|
buffer.Lock();
|
||||||
for (int y = 0; y < cornerRange.Length; y++) {
|
for (int y = 0; y < conf.WindowCornerCutShape.Count; y++) {
|
||||||
for (int x = 0; x < cornerRange[y]; x++) {
|
for (int x = 0; x < conf.WindowCornerCutShape[y]; x++) {
|
||||||
buffer.SetColorAt(x, y, Color.Transparent);
|
buffer.SetColorAt(x, y, Color.Transparent);
|
||||||
buffer.SetColorAt(image.Width-1-x, y, Color.Transparent);
|
buffer.SetColorAt(image.Width-1-x, y, Color.Transparent);
|
||||||
buffer.SetColorAt(image.Width-1-x, image.Height-1-y, Color.Transparent);
|
buffer.SetColorAt(image.Width-1-x, image.Height-1-y, Color.Transparent);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue