summaryrefslogtreecommitdiff
path: root/BitmapChar.cs
diff options
context:
space:
mode:
Diffstat (limited to 'BitmapChar.cs')
-rw-r--r--BitmapChar.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/BitmapChar.cs b/BitmapChar.cs
index b161d4f..432dce8 100644
--- a/BitmapChar.cs
+++ b/BitmapChar.cs
@@ -192,6 +192,40 @@ namespace BitmapFontEd
m_data=d;
m_changed=true;
}
+
+ public void DropShadow(int dx, int dy, Color col)
+ {
+ Color[,] d=new Color[m_width,m_height];
+
+ // I'm sure this is too convoluted...
+ //
+ for(int y=0;y<m_height;y++)
+ for(int x=0;x<m_width;x++)
+ d[x,y]=Color.Black;
+
+ for(int y=0;y<m_height;y++)
+ for(int x=0;x<m_width;x++)
+ if (m_data[x,y]!=Color.Black)
+ {
+ int nx=x+dx;
+ int ny=y+dy;
+
+ if (nx>=0 && nx<m_width && ny>=0 && ny<m_height &&
+ m_data[nx,ny]==Color.Black)
+ {
+ d[nx,ny]=col;
+ }
+ }
+
+ for(int y=0;y<m_height;y++)
+ for(int x=0;x<m_width;x++)
+ if (d[x,y]!=Color.Black)
+ {
+ m_data[x,y]=d[x,y];
+ }
+
+ m_changed=true;
+ }
public void Output(Stream stream)
{