|
@@ -78,7 +78,14 @@ namespace BBIWARG.Images
|
|
|
/// <returns>the depth at the position</returns>
|
|
|
public Int16 getDepthAt(int x, int y)
|
|
|
{
|
|
|
- return (Int16)(MinDepth + Image.Data[y, x, 0]);
|
|
|
+ try
|
|
|
+ {
|
|
|
+ return (Int16)(MinDepth + Image.Data[y, x, 0]);
|
|
|
+ }
|
|
|
+ catch (IndexOutOfRangeException e)
|
|
|
+ {
|
|
|
+ return (Int16)(MinDepth + Image.Data[0, 0, 0]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|