A
assaf
hi all
this is the original dot net Region.GetRegionScans.
i am experiencing StackOverflowException when i call it with a
many-rectangle region.
i am looking for the recurssion,
but i can't find it...
can u?
public RectangleF[] GetRegionScans(Matrix matrix)
{
int num4;
GPRECTF gprectf1;
if (matrix == null)
{
throw new ArgumentNullException("matrix");
}
int num1 = 0;
int num2 = SafeNativeMethods.GdipGetRegionScansCount(new
HandleRef(this, this.nativeRegion), out num1, new HandleRef(matrix,
matrix.nativeMatrix));
if (num2 != 0)
{
throw SafeNativeMethods.StatusException(num2);
}
int num3 = Marshal.SizeOf(typeof(GPRECTF));
IntPtr ptr1 = Marshal.AllocHGlobal(((int) (num3 * num1)));
num2 = SafeNativeMethods.GdipGetRegionScans(new HandleRef(this,
this.nativeRegion), ptr1, out num1, new HandleRef(matrix,
matrix.nativeMatrix));
if (num2 != 0)
{
Marshal.FreeHGlobal(ptr1);
throw SafeNativeMethods.StatusException(num2);
}
gprectf1 = new GPRECTF();
RectangleF[] efArray1 = new RectangleF[num1];
for (num4 = 0; (num4 < num1); ++num4)
{
gprectf1 = ((GPRECTF)
UnsafeNativeMethods.PtrToStructure(((IntPtr) (((long) ptr1) + (num3 *
num4))), typeof(GPRECTF)));
efArray1[num4] = gprectf1.ToRectangleF();
}
return efArray1;
}
assaf
this is the original dot net Region.GetRegionScans.
i am experiencing StackOverflowException when i call it with a
many-rectangle region.
i am looking for the recurssion,
but i can't find it...
can u?
public RectangleF[] GetRegionScans(Matrix matrix)
{
int num4;
GPRECTF gprectf1;
if (matrix == null)
{
throw new ArgumentNullException("matrix");
}
int num1 = 0;
int num2 = SafeNativeMethods.GdipGetRegionScansCount(new
HandleRef(this, this.nativeRegion), out num1, new HandleRef(matrix,
matrix.nativeMatrix));
if (num2 != 0)
{
throw SafeNativeMethods.StatusException(num2);
}
int num3 = Marshal.SizeOf(typeof(GPRECTF));
IntPtr ptr1 = Marshal.AllocHGlobal(((int) (num3 * num1)));
num2 = SafeNativeMethods.GdipGetRegionScans(new HandleRef(this,
this.nativeRegion), ptr1, out num1, new HandleRef(matrix,
matrix.nativeMatrix));
if (num2 != 0)
{
Marshal.FreeHGlobal(ptr1);
throw SafeNativeMethods.StatusException(num2);
}
gprectf1 = new GPRECTF();
RectangleF[] efArray1 = new RectangleF[num1];
for (num4 = 0; (num4 < num1); ++num4)
{
gprectf1 = ((GPRECTF)
UnsafeNativeMethods.PtrToStructure(((IntPtr) (((long) ptr1) + (num3 *
num4))), typeof(GPRECTF)));
efArray1[num4] = gprectf1.ToRectangleF();
}
return efArray1;
}
assaf