memory image

  • Thread starter Thread starter cs
  • Start date Start date
C

cs

In java I ahve the following code

g.drawImage(this.createImage(new MemoryImageSource(r.width, r.height,
this.colormap, backstore, r.y*this.width+r.x, this.width)), r.x, r.y, null);

where backstore is a byte array (signed) with only zeros

In c# I am creating a memory stream, putting the same ammount of signed
bytes in it, all with zeros as well, and then doing a
System.Drawing.Image.FromStream, but I get a an error:

System.ArgumentException: Invalid parameter used.

at System.Drawing.Image.FromStream(Stream stream, Boolean
useEmbeddedColorManagement)

at System.Drawing.Image.FromStream(Stream stream)

Any ideas how to fix this?
 
I have figured it out, used hte colormap to get the right int in ARBG, plus
my image was clipped, etc.
The only problem I got is that the quality of my image is crap on c#
compared to the java version, I am sure im doing something wrong, I just
odnt know what.
 
Back
Top