mirror of
https://github.com/greenshot/greenshot
synced 2025-08-25 07:36:38 -07:00
截图完成时自动设置默认边框特效
This commit is contained in:
parent
28358f4a9a
commit
ebd9b70a43
12 changed files with 33 additions and 9 deletions
|
@ -65,6 +65,7 @@ namespace Greenshot.Destinations {
|
|||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
try {
|
||||
base.SetDefaults(surface);
|
||||
ClipboardHelper.SetClipboardData(surface);
|
||||
exportInformation.ExportMade = true;
|
||||
} catch (Exception) {
|
||||
|
|
|
@ -85,7 +85,8 @@ namespace Greenshot.Destinations {
|
|||
}
|
||||
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
base.SetDefaults(surface);
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
// Make sure we collect the garbage before opening the screenshot
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
|
|
|
@ -50,7 +50,8 @@ namespace Greenshot.Destinations {
|
|||
public override Image DisplayIcon => GreenshotResources.getImage("Save.Image");
|
||||
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
base.SetDefaults(surface);
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
bool outputMade;
|
||||
bool overwrite;
|
||||
string fullPath;
|
||||
|
|
|
@ -70,7 +70,8 @@ namespace Greenshot.Destinations {
|
|||
// Bug #2918756 don't overwrite path if SaveWithDialog returns null!
|
||||
var savedTo = ImageOutput.SaveWithDialog(surface, captureDetails);
|
||||
if (savedTo != null) {
|
||||
exportInformation.ExportMade = true;
|
||||
base.SetDefaults(surface);
|
||||
exportInformation.ExportMade = true;
|
||||
exportInformation.Filepath = savedTo;
|
||||
captureDetails.Filename = savedTo;
|
||||
conf.OutputFileAsFullpath = savedTo;
|
||||
|
|
|
@ -47,6 +47,7 @@ namespace Greenshot.Destinations {
|
|||
/// <param name="captureDetails">Details of the capture</param>
|
||||
/// <returns>true if export was made</returns>
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
base.SetDefaults(surface);
|
||||
List<IDestination> destinations = new List<IDestination>();
|
||||
foreach(IDestination destination in DestinationHelper.GetAllDestinations()) {
|
||||
if ("Picker".Equals(destination.Designation)) {
|
||||
|
|
|
@ -116,7 +116,8 @@ namespace Greenshot.Destinations {
|
|||
/// <param name="captureDetails"></param>
|
||||
/// <returns>ExportInformation</returns>
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
base.SetDefaults(surface);
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
PrinterSettings printerSettings;
|
||||
if (!string.IsNullOrEmpty(printerName)) {
|
||||
using (PrintHelper printHelper = new PrintHelper(surface, captureDetails)) {
|
||||
|
|
|
@ -72,7 +72,8 @@ namespace GreenshotOfficePlugin {
|
|||
}
|
||||
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
base.SetDefaults(surface);
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
bool createdFile = false;
|
||||
string imageFile = captureDetails.Filename;
|
||||
if (imageFile == null || surface.Modified || !Regex.IsMatch(imageFile, @".*(\.png|\.gif|\.jpg|\.jpeg|\.tiff|\.bmp)$")) {
|
||||
|
|
|
@ -99,7 +99,8 @@ namespace GreenshotOfficePlugin {
|
|||
}
|
||||
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
base.SetDefaults(surface);
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
|
||||
if (page == null) {
|
||||
try {
|
||||
|
|
|
@ -113,7 +113,8 @@ namespace GreenshotOfficePlugin {
|
|||
/// <param name="captureDetails"></param>
|
||||
/// <returns></returns>
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
base.SetDefaults(surface);
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
// Outlook logic
|
||||
string tmpFile = captureDetails.Filename;
|
||||
if (tmpFile == null || surface.Modified || !Regex.IsMatch(tmpFile, @".*(\.png|\.gif|\.jpg|\.jpeg|\.tiff|\.bmp)$")) {
|
||||
|
|
|
@ -89,7 +89,8 @@ namespace GreenshotOfficePlugin {
|
|||
}
|
||||
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
base.SetDefaults(surface);
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
string tmpFile = captureDetails.Filename;
|
||||
Size imageSize = Size.Empty;
|
||||
if (tmpFile == null || surface.Modified || !Regex.IsMatch(tmpFile, @".*(\.png|\.gif|\.jpg|\.jpeg|\.tiff|\.bmp)$")) {
|
||||
|
|
|
@ -73,7 +73,8 @@ namespace GreenshotOfficePlugin {
|
|||
}
|
||||
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
base.SetDefaults(surface);
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
string tmpFile = captureDetails.Filename;
|
||||
if (tmpFile == null || surface.Modified || !Regex.IsMatch(tmpFile, @".*(\.png|\.gif|\.jpg|\.jpeg|\.tiff|\.bmp)$")) {
|
||||
tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new SurfaceOutputSettings().PreventGreenshotFormat());
|
||||
|
|
|
@ -89,6 +89,19 @@ namespace GreenshotPlugin.Core {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// set defaults infomation when export capture.
|
||||
/// </summary>
|
||||
public virtual void SetDefaults(ISurface surface)
|
||||
{
|
||||
if (null == surface)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//set default border effect.
|
||||
surface.ApplyBitmapEffect(new Effects.BorderEffect());
|
||||
}
|
||||
|
||||
public abstract ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails);
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue