|
|
In that case, it's not going to take less than 900 MB's of memory unless you don't need it to be in memory as a bitmap.
What is the image going to be used for? Possibly the application allows you to stream in the original 350 MB file (which I assume is a compressed format?) rather than a bitmap.
|
|
|
|
|
i want to use it for GPS map. the image is in jpg format
is there anyway to loading a part of the image in to application?
|
|
|
|
|
You want to partition the image. (Or do the drawing in a better way ... a GIS style data backed vector render is probably what you want for a GPS map, but I digress.) A JPEG isn't a partitioned format, so I suggest that on first use, you partition it into sensible size (one screen or larger, file size a few MB) tiles and save each one as a file, then dispose of the huge image. You can then implement a load-on-demand tiling algorithm. This will still take 900MB of memory (in fact a little more, that plus one tile so maybe 920MB) during the partitioning operation, and I don't think there's a way to avoid that if you are required to use a huge JPEG as the source. Once the app is running you will need to have up to 4 tiles loaded at any one time, possibly up to 9 if you want to preload for scrolling.
Note though that your OS will almost certainly leave these files in some sort of in memory cache and they will still shunt other things out of the cache, so although your application will play more nicely with the memory it is still going to be slightly unwieldy.
|
|
|
|
|
BobJanova wrote: Note though that your OS will almost certainly leave these files in some sort of in memory cache and they will still shunt other things out of the cache, so although your application will play more nicely with the memory it is still going to be slightly unwieldy.
Odd comment. If the OS decides to cache those files, even at the cost of other cached items, then it probably has good reason. It could speed up scrolling over an area a second time, as the tile will still be in memory. Exactly what caching is supposed to do.
You make it sound like the OS caching is a bad thing... If the OS is good, then it's quite capable of predicting what files are more likely to be reused.
So, what point you are trying to make here, I don't know ...
|
|
|
|
|
Yeah I couldn't quite find the words to phrase that how I wanted. It is not a bad thing, but just something to be aware of.
|
|
|
|
|
Ahh like that. It's true that it might be fun to be aware of, but actually it's not your concern as a programmer what the operating system does and doesn't. Certainly where, in this case, it can only work to your advantage.
Not to mention that there is no easy way of preventing this behaviour. I think there might be a way, on opening, to specify that a file will only be used once and therefore does not need to be cached. Not entirely sure on that though.
|
|
|
|
|
IMO, I have to tell you that there are certainly memory issues when dealing with bitmaps especially of larger size. For project such as GPS, just have larger memory and couple of parallel programming techniques with memory cleau-ups
|
|
|
|
|
Hi to whomever may be reading this, my name is Njabulo Mpungose I am a first year IT student at the Durban University of technology in Durban South Africa.My current programming subjects are JavaScript,Java and c#, I am trying to teach myself some other languages as well.I am looking for somebody who has the time and patience to help me along.I think I have grasped the basics but I require someone to help me sort out the murky areas of computer programming. I would highly appreciate it if someone took a chance on me.
My personal email address is: 21124627@dut.ac.za
|
|
|
|
|
First, don't include an email. This is a public forum and any responses should be posted here. Also, if anyone would like to respond privately to you they can use the functionality here to do so.
You may want to contact any of the CP Mentors[^] to ask this.
And of course, post any questions you have here. Just make sore to read the posting guidelines, http://www.codeproject.com/Messages/1278604/How-to-get-an-answer-to-your-question.aspx[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
What about rate payment?
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
1) Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know.
2) Nearly everybody here works for a living, and doesn't have the time available to do one-to-one mentoring. Besides, isn't that what you are paying your course fees for? A Tutor?
3) Don't try to learn everything at once: if they are teaching you JavaScript,Java and C#, then stick to just them - there is a heck of a lot to learn in the last one alone! Learning in breadth can only be effective when you have reached a sufficient depth of knowledge and experience.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I want to connect biometric device in my web base application please help me
|
|
|
|
|
That's far too broad a question. Presumably the device has an API associated with it - you should contemplate using this API, reading the documentation beforehand. Also, are you intending for the device to be situated on the client side? If so, you're probably not going to be able to do what you think you want to do without deploying your functionality as an ActiveX control, and that opens up a whole can of worms.
|
|
|
|
|
How to use goal seek like approach or alternative in calculation
|
|
|
|
|
Judging from the votes, your question is not clear. Could you please explain more what it is you are trying to do?
This is too general a question to be answered; you need to give specifics
|
|
|
|
|
See the algorithm in the "More information" section on this[^] page.
/ravi
|
|
|
|
|
having problem to translate from WinForm to Windows-CE C# program - FTP transfer
i have this code for transfer from Local computer to FTP server
its work excellent on WinForm, i must have this on Windows-CE and it dosnt work
the code:
string MyFile = @"d:\PC.sdf";
string url = "ftp://127.0.0.1/PC.sdf";
FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(url);
request.Method = WebRequestMethods.Ftp.UploadFile;
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = false;
using (Stream reqStream = request.GetRequestStream())
{
int count = 0;
byte[] buffer = new byte[100];
using (FileStream file = new FileStream(MyFile, FileMode.Open))
{
while ((count = file.Read(buffer, 0, 100)) > 0)
{
reqStream.Write(buffer, 0, count);
}
}
}
in WinCE there isnt FtpWebRequest or FtpWebRequest
i think that i need to use OpenNetCF ????
can i get any C# sample code for this ?
modified on Friday, August 12, 2011 6:08 AM
|
|
|
|
|
Firstly, always use the code block widget when posting code samples - it preserves the formatting and makes it easier to read. (you can edit your question and add it)
Secondly, "it dosnt work" isn't particularly helpful - what does it do that you didn't expect, or not do that you did? Was there an error message?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
We had a module that could log to an Oracle (and file if you wished), but my boss now wants to use the MS Enterprise library, where Microsoft of course only provides information on how to log to SQLServer. I searched on the net and found an article about how to log to Oracle, but unfortunately it is outdated (still uses Lib 2.0 and we're on Lib 5.0) Has anyone have any experience with this, because I'm stuck on this a little.
I did find a workaround by modifying the existing dll we had, attach it to the Enterprise Lib and use that one to write to Oracle, but personally I feel it is slow and the format of the log is dreadfull.
Any pointers on this would be very helpful.
thanks.
V.
|
|
|
|
|
Hello.
If I have an uint value, that may be differnt lenghts, how would I create a new int from it at a fixed length, or better still select specific digits.
e.g
uint begin = 293844; OR 29388493
uint shorter = 2938;
OR
uint select = 2339 (skip every other digit).
I basically want a new value from a uint that could be different sizes, and ensure the new value is a fixed length in size.
I have a feeling I need to use bit wise operations, but still dont understand them fully.
Thank you in advance for any advice.
Kind Regards,
Stephen
|
|
|
|
|
stephen.darling wrote: I have a feeling I need to use bit wise operations
Looks to me like you should be looking at string operations. Convert your number to a string, then play with characters or substrings. Convert back at the end if you need to. Bitwise operations don't match up with decimal digits.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Peter_in_2780 wrote: Convert your number to a string, then play with characters or substrings. Convert back at the end if you need to
Wow! Never even thought about doing it that way!
Thank you,
Stephen
|
|
|
|
|
You could do this with bitwise math if you also throw in a lot of divisions and multiplies by 10..
But it will be a mess.
Why are you working with decimal digits anyway?
What is the actual problem you're trying to solve, maybe it could be done with hex digits instead?
|
|
|
|
|
A uint is always the same size (32 bits).
What you're trying to do is string manipulation of a decimal number, quite a strange thing to do but probably best done on the string representation.
|
|
|
|