I am facing some problem in Bitmap.Save function...
Here is the scenario:
- Create a bitmap image A from a bitmap file
- Create a bitmap image B with same attributes as bitmap image A
- Get BitmapData using LockBits on bitmap image B
- Read the bytes information of bitmap A
- Copy bytes information to BitmapData (of bitmap B) using Marshal.Copy
- UnlockBits BitmapData of bitmap image B
- Update palette information of bitmap image B
- Clone bitmap image B to bitmap image C
- Save bitmap image C to a file over a network using Bitmap.Save
During save operation an exception is thrown "Attempted to read-write
protected memory..."
This happens only sometimes otherwise works without problem.
Any help is appreciated!
Ramendra
MichaelC - 08 May 2008 03:33 GMT
>I am facing some problem in Bitmap.Save function...
> Here is the scenario:
[quoted text clipped - 14 lines]
>
> Any help is appreciated!
I think we'd need to see the exact code. Can you make the *simplest*
possible code that demonstrates the problem?
Michael