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
[CgsAddInMacro] | |
public string[] ReadLines(string filePath) | |
{ | |
filePath = filePath.Trim('\"'); | |
string[] lines = File.ReadAllLines(filePath); | |
return lines; | |
} | |
//== igualdade | |
//= atribuição |
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
[CgsAddInMacro] | |
public void CenterSelectionInPage() | |
{ | |
ShapeRange sr = corelApp.ActiveSelectionRange; | |
sr.CenterX = corelApp.ActivePage.CenterX; | |
sr.CenterY = corelApp.ActivePage.CenterY; | |
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
Shape shape = corelApp.ActiveShape; | |
if (shape.Type == cdrShapeType.cdrBitmapShape) | |
{ | |
string effectCommand = "GaussianBlurEffect GaussianBlurRadius=2500,GaussianBlurResampled=0"; | |
shape.Bitmap.ApplyBitmapEffect("effect", effectCommand); | |
} |
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
[CgsAddInMacro] | |
public void InvertSelection() | |
{ | |
ShapeRange selectedRange, allRange; | |
selectedRange = corelApp.ActiveSelectionRange; | |
allRange = corelApp?.ActivePage.Shapes.All(); | |
allRange.RemoveRange(selectedRange); | |
selectedRange.RemoveFromSelection(); |
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
[CgsAddInMacro] | |
public void CreateConnector() | |
{ | |
Layer l = corelApp.ActiveDocument.ActiveLayer; | |
corelApp.ActiveDocument.BeginCommandGroup(); | |
Shape el = l.CreateEllipse2(0, 0, 5); | |
Shape text = l.CreateArtisticText(20, 10, "Ellipse"); | |
SnapPoint elP = el.SnapPoints.FindClosest(cdrPointType.cdrSnapPointObject, el.RightX, el.CenterY); | |
SnapPoint textP = text.SnapPoints.FindClosest(cdrPointType.cdrSnapPointObject, text.LeftX, text.CenterY); |
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
public class EAN8 | |
{ | |
private Corel.Interop.VGCore.Application app; | |
private const int EAN8BRASIL = 789; | |
// 0 1 2 3 4 5 6 7 8 9 | |
private List<bool[]> CodDigL = new List<bool[]>() { new bool[7] { false, false, false, true, true, false, true }, new bool[7] { false, false, true, true, false, false, true }, new bool[7] { false, false, true, false, false, true, true }, new bool[7] { false, true, true, true, true, false, true }, new |
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
public void CreateTable() | |
{ | |
try | |
{ | |
Layer l = corelApp.ActiveLayer; | |
l.Shapes.All().Delete(); | |
double width = l.Page.SizeWidth; | |
double cellHeight = 9; | |
int columns = 2; | |
int rows = 50; |
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
private void FastGrid(Shape firstShape,int cols, int rows) | |
{ | |
try | |
{ | |
int mShapes = cols * rows; | |
ShapeRange gridShapeRange = corelApp.CreateShapeRange(); | |
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
public void FitContentToPage(Page p,bool proportion = true, double margin = 0) | |
{ | |
try | |
{ | |
corelApp.Optimization = true; | |
ShapeRange sr = p.Shapes.All(); | |
ShapeRange guides = p.FindShapes(Type: cdrShapeType.cdrGuidelineShape); | |
sr.RemoveRange(guides); | |
Rect bBox = p.BoundingBox; |