Forum Moderators: open
try {
byte *srcp;
byte *dstp;
float m = (float)src.Width / (float)dst.Width;
for (int r = 0; r < dst.Height; ++r) {
dstp = (byte *)dstbd.Scan0;
dstp += dstbd.Stride * r;
for (int c = 0; c < dst.Width; ++c) {
srcp = (byte *)srcbd.Scan0;
srcp += srcbd.Stride * (int)(r * m);
srcp += (int)(c * m);
*dstp++ = *srcp;
}
}
}
finally {
src.UnlockBits(srcbd);
}
In the C# project, there is a setting at the project level that has to be set to allow unsafe code. There is no such setting in VB.NET.
The only solution from VB.NET is to call a DLL that has been written in C#.