Editing images pixel by pixel in CE
I am writing software in Windows CE for my Win Mobile 5 handheld PC. The reason why I am using CE is I have very little (next to none) experience in .NET and I feel more comfortable writing in a VB6 environment (and I have a CE development system installed to allow me to do this in VB6).
A piece of code I am writing displays a map on-screen (taken from streetmap) in an image box. It loads a BMP file (seems CE items can only load BMP or even less efficient image formats) and displays it in the image box which I will then use for navigation (not through a GPS system...I'm not writing that sort of program). I want to then read in the values of specific pixels within that image and perform a filter on the pixel and re-draw it on the image...I basically want to highlight specific streets and will have co-ordinate data on each street in the program.
Has anyone got suggestions on how I would be able to manipulate pixels in an image like that?
Another aspect of this program I am working on is a more efficient way to store map-style images by reducing the number of colours...in theory I could get the maps I am displaying into about 5k or so...I'm looking for a method that could manipulate an image fast enough in CE, but the priority here is the above (editing specific pixels rather than the whole image :-))
Re: Editing images pixel by pixel in CE
I'm glad to see the helping spirit hasn't left this place
Re: Editing images pixel by pixel in CE
Frankly, I had no idea that you could write for Mobile 5 using VB6 syntax. That shocks me. I thought eVB was pretty bad, especially since it was VBScript behind the scenes. The mobile dev forum doesn't get nearly the traffic the main languages get, and you're asking about something I have never heard of. If I'm a representative sample (which may or may not be true), then you can't be expecting anything too quick here.
Obviously, you want to take the pixel as a four byte integer, and use a mask to alter it. This would be easiest if done in place. I have no familiarity with a BMP format in an imagebox in VB6. In fact, I have only a casual understanding of BMP format, and no familiarity of imageboxes in VB6. However, it seems that if you have a BMP, you should also have an array of pixels. If you have that array, and they are not already a four byte integer (a long in VB6), it seems that VB6 had the functions to convert other formats to the four byte integer (though it has been years, so I may be remembering .NET functions, instead).
What you may have to do, depending on how the control works, is have the control, and a duplicate image in memory. You would then alter the duplicate image, and replace the one on the control.
That's as far as I get with my limitted knowledge of those controls and file formats. I'd do better at the masking part, but that's the easy part.