Пример #1
0
 public void DrawWidth(GLEx g, int x, int y)
 {
     try
     {
         if (drawTexWidth == null)
         {
             LPixmap img = new LPixmap(width, height, true);
             for (int i = 0; i < width; i++)
             {
                 img.SetColor(
                     (byte)((start.R * (width - i)) / width
                            + (end.R * i) / width),
                     (byte)((start.G * (width - i)) / width
                            + (end.G * i) / width),
                     (byte)((start.B * (width - i)) / width
                            + (end.B * i) / width), (byte)alpha);
                 img.DrawLine(i, 0, i, height);
             }
             drawTexWidth = img.Texture;
         }
         g.DrawTexture(drawTexWidth, x, y);
     }
     catch
     {
         for (int i = 0; i < width; i++)
         {
             g.SetColor(
                 (byte)((start.R * (width - i)) / width
                        + (end.R * i) / width),
                 (byte)((start.G * (width - i)) / width
                        + (end.G * i) / width),
                 (byte)((start.B * (width - i)) / width
                        + (end.B * i) / width), (byte)alpha);
             g.DrawLine(i + x, y, i + x, y + height);
         }
     }
 }
Пример #2
0
 public void DrawHeight(GLEx g, int x, int y)
 {
     try
     {
         if (drawTexHeight == null)
         {
             LPixmap img = new LPixmap(width, height, true);
             for (int i = 0; i < height; i++)
             {
                 img.SetColor((byte)(
                                  (start.R * (height - i)) / height
                                  + (end.R * i) / height),
                              (byte)((start.G * (height - i)) / height
                                     + (end.G * i) / height),
                              (byte)((start.B * (height - i)) / height
                                     + (end.B * i) / height), (byte)(alpha));
                 img.DrawLine(0, i, width, i);
             }
             drawTexHeight = img.Texture;
         }
         g.DrawTexture(drawTexHeight, x, y);
     }
     catch
     {
         for (int i = 0; i < height; i++)
         {
             g.SetColor(
                 (byte)((start.R * (height - i)) / height
                        + (end.R * i) / height),
                 (byte)((start.G * (height - i)) / height
                        + (end.G * i) / height),
                 (byte)((start.B * (height - i)) / height
                        + (end.B * i) / height), (byte)alpha);
             g.DrawLine(x, i + y, x + width, i + y);
         }
     }
 }
Пример #3
0
 public void DrawHeight(LPixmap g, int x, int y)
 {
     try
     {
         if (drawImgHeight == null)
         {
             drawImgHeight = new LPixmap(width, height, true);
             for (int i = 0; i < height; i++)
             {
                 drawImgHeight.SetColor(
                     (byte)((start.R * (height - i)) / height
                            + (end.R * i) / height),
                     (byte)((start.G * (height - i)) / height
                            + (end.G * i) / height),
                     (byte)((start.B * (height - i)) / height
                            + (end.B * i) / height), (byte)alpha);
                 drawImgHeight.DrawLine(0, i, width, i);
             }
         }
         g.DrawPixmap(drawImgHeight, x, y);
     }
     catch
     {
         for (int i = 0; i < height; i++)
         {
             g.SetColor((byte)(
                            (start.R * (height - i)) / height
                            + (end.R * i) / height),
                        (byte)((start.G * (height - i)) / height
                               + (end.G * i) / height),
                        (byte)((start.B * (height - i)) / height
                               + (end.B * i) / height), (byte)alpha);
             g.DrawLine(x, i + y, x + width, i + y);
         }
     }
 }
Пример #4
0
 public void DrawWidth(LPixmap g, int x, int y)
 {
     try
     {
         if (drawImgWidth == null)
         {
             drawImgWidth = new LPixmap(width, height, true);
             for (int i = 0; i < width; i++)
             {
                 drawImgWidth.SetColor(
                     (byte)((start.R * (width - i)) / width
                            + (end.R * i) / width),
                     (byte)((start.G * (width - i)) / width
                            + (end.G * i) / width),
                     (byte)((start.B * (width - i)) / width
                            + (end.B * i) / width), (byte)alpha);
                 drawImgWidth.DrawLine(i, 0, i, height);
             }
         }
         g.DrawPixmap(drawImgWidth, x, y);
     }
     catch
     {
         for (int i = 0; i < width; i++)
         {
             g.SetColor(
                 (byte)((start.R * (width - i)) / width
                        + (end.R * i) / width),
                 (byte)((start.G * (width - i)) / width
                        + (end.G * i) / width),
                 (byte)((start.B * (width - i)) / width
                        + (end.B * i) / width), (byte)alpha);
             g.DrawLine(i + x, y, i + x, y + height);
         }
     }
 }
Пример #5
0
 public void DrawWidth(LPixmap g, int x, int y)
 {
     try
     {
         if (drawImgWidth == null)
         {
             drawImgWidth = new LPixmap(width, height, true);
             for (int i = 0; i < width; i++)
             {
                 drawImgWidth.SetColor(
                         (byte)((start.R * (width - i)) / width
                                 + (end.R * i) / width),
                         (byte)((start.G * (width - i)) / width
                                 + (end.G * i) / width),
                         (byte)((start.B * (width - i)) / width
                                 + (end.B * i) / width), (byte)alpha);
                 drawImgWidth.DrawLine(i, 0, i, height);
             }
         }
         g.DrawPixmap(drawImgWidth, x, y);
     }
     catch
     {
         for (int i = 0; i < width; i++)
         {
             g.SetColor(
                     (byte)((start.R * (width - i)) / width
                             + (end.R * i) / width),
                     (byte)((start.G * (width - i)) / width
                             + (end.G * i) / width),
                     (byte)((start.B * (width - i)) / width
                             + (end.B * i) / width), (byte)alpha);
             g.DrawLine(i + x, y, i + x, y + height);
         }
     }
 }
Пример #6
0
 public void DrawWidth(GLEx g, int x, int y)
 {
     try
     {
         if (drawTexWidth == null)
         {
             LPixmap img = new LPixmap(width, height, true);
             for (int i = 0; i < width; i++)
             {
                 img.SetColor(
                         (byte)((start.R * (width - i)) / width
                                 + (end.R * i) / width),
                         (byte)((start.G * (width - i)) / width
                                 + (end.G * i) / width),
                         (byte)((start.B * (width - i)) / width
                                 + (end.B * i) / width), (byte)alpha);
                 img.DrawLine(i, 0, i, height);
             }
             drawTexWidth = img.Texture;
         }
         g.DrawTexture(drawTexWidth, x, y);
     }
     catch
     {
         for (int i = 0; i < width; i++)
         {
             g.SetColor(
                         (byte)((start.R * (width - i)) / width
                                 + (end.R * i) / width),
                         (byte)((start.G * (width - i)) / width
                                 + (end.G * i) / width),
                         (byte)((start.B * (width - i)) / width
                                 + (end.B * i) / width), (byte)alpha);
             g.DrawLine(i + x, y, i + x, y + height);
         }
     }
 }
Пример #7
0
 public void DrawHeight(LPixmap g, int x, int y)
 {
     try
     {
         if (drawImgHeight == null)
         {
             drawImgHeight = new LPixmap(width, height, true);
             for (int i = 0; i < height; i++)
             {
                 drawImgHeight.SetColor(
                         (byte)((start.R * (height - i)) / height
                                 + (end.R * i) / height),
                         (byte)((start.G * (height - i)) / height
                                 + (end.G * i) / height),
                         (byte)((start.B * (height - i)) / height
                                 + (end.B * i) / height), (byte)alpha);
                 drawImgHeight.DrawLine(0, i, width, i);
             }
         }
         g.DrawPixmap(drawImgHeight, x, y);
     }
     catch
     {
         for (int i = 0; i < height; i++)
         {
             g.SetColor((byte)(
                     (start.R * (height - i)) / height
                             + (end.R * i) / height),
                    (byte)((start.G * (height - i)) / height
                             + (end.G * i) / height),
                     (byte)((start.B * (height - i)) / height
                             + (end.B * i) / height), (byte)alpha);
             g.DrawLine(x, i + y, x + width, i + y);
         }
     }
 }
Пример #8
0
 public void DrawHeight(GLEx g, int x, int y)
 {
     try
     {
         if (drawTexHeight == null)
         {
             LPixmap img = new LPixmap(width, height, true);
             for (int i = 0; i < height; i++)
             {
                 img.SetColor((byte)(
                         (start.R * (height - i)) / height
                                 + (end.R * i) / height),
                         (byte)((start.G * (height - i)) / height
                                 + (end.G * i) / height),
                         (byte)((start.B * (height - i)) / height
                                 + (end.B * i) / height), (byte)(alpha));
                 img.DrawLine(0, i, width, i);
             }
             drawTexHeight = img.Texture;
         }
         g.DrawTexture(drawTexHeight, x, y);
     }
     catch
     {
         for (int i = 0; i < height; i++)
         {
             g.SetColor(
                     (byte)((start.R * (height - i)) / height
                             + (end.R * i) / height),
                     (byte)((start.G * (height - i)) / height
                             + (end.G * i) / height),
                     (byte)((start.B * (height - i)) / height
                             + (end.B * i) / height), (byte)alpha);
             g.DrawLine(x, i + y, x + width, i + y);
         }
     }
 }