Hello,
I've been writing plugins with Code Lap , to learn more and to practice.. any way i wrote these Lines To Render Gird lines..
#region UICode
int Amount1 = 10; // [0,100] Width
int Amount2 = 10; // [0,100] Height
ColorBgra Amount3 = ColorBgra.FromBgr(0,0,0); // Color
#endregion
void Render(Surface dst, Surface src, Rectangle rect)
{
// Declerations
Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
Graphics g = new RenderArgs(dst).Graphics;
System.Drawing.Pen mypen= new System.Drawing.Pen(Amount3);
//Grid Lines
for (int w=0; w<rect.Right; w+=Amount1)
g.DrawLine(mypen,w,0,w,rect.Bottom);
for (int h=0; h<rect.Bottom; h+=Amount2)
g.DrawLine(mypen,0,h,rect.Right,h);
}
Simple code, Any way it renders fine , for the first time , but when i edit the Settings it renders again above the old one, and so on
What i need is to render these lines only once, when the user edits the settings it shall only edit the current lines not render other lines, Got me?
I know this may be a stupid question , but please be patient with me .. i'm just a beggener learning
Thanks
Ahmed