473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

memory image

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?
Nov 16 '05 #1
1 2546
cs
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.
"cs" <[rem]casolorz[rem]@hot[rem]mail.com> wrote in message
news:ON**************@TK2MSFTNGP09.phx.gbl...
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?

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ian | last post by:
I have and Access 97 DB that prints a report that has many pages, sometime about 800-1000 page, each page contains a colour picture along with text boxes. The pictures are displayed on the...
1
by: Aravind | last post by:
Hi, I am trying to create a image object out of a bitmap file like Image img = new Bitmap(@"c-\CurDisplayImage.bmp"); ,I found the memory of the process is increased twice as the bitmap size ,...
5
by: Sharon | last post by:
I’m writing a Windows application. In the form I have a Panel and inside the panel I have a PictureBox control. I’m loading the PictureBox control with BMP image that has the following...
3
by: Jeff | last post by:
I've been working on an application for a while now that has been giving me some trouble when it comes to working with a picturebox and memory usage. My company deals with digital imaging, so we...
0
by: Mattia | last post by:
************************************************** Manage image without exhausted memory ************************************************** Hi; I have a big problem. I must create a script that...
62
by: ivan.leben | last post by:
How can I really delete a preloaded image from memory/disk cache? Let's say I preload an image by creating an Image object and setting its src attribute to desired URL: var img = new Image();...
6
by: comp.lang.php | last post by:
I have an image that's only 100K in size, and I am working with 8mb of memory. If I do this: print_r(ceil((int)ini_get('memory_limit') * 10 *...
0
by: krishnasamy | last post by:
Hello, I am writing a DLL for Capturing the Image from Camera Device using Camera SDK DLL. All the calls made to functions in Camera SDK DLL are working properly as I am able to get a return...
6
by: zissop | last post by:
Hello I have a strange situation with my ASP.Net applications running on Windows 2003 Server x64. As soon as they get instantiated (a visitor hits a page). the virtual memory they allocate goes to...
6
by: Jerry Spence1 | last post by:
I am using a network camera that saves the image in a byte array in memory (via their ocx component, and in the OnNewImage event I can get the pointer to the image and the byte length as...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.