I'm trying to use this class but I'm getting a Generic error occured in GDI+ in Image.Save() method. From what I read it's some stream I need to close but I don't know which one.

I'm calling using this:

 Image image = Image.FromFile(@"C:\a.jpg");
            using (var resized = ImageUtilities.ResizeImage(image, 50, 100))
            {
                //save the resized image as a jpeg with a quality of 90
                ImageUtilities.SaveJpeg(@"C:\myimage.jpeg", resized, 90);
            }


Why is that error and how do I solve this?


Question: Best way to create custom building's map for iOS
Answer: Generally there are two types of map application:

A) They display a map, (with or without  a user position) without needing to calculate a path like a navigation system does (see point B)

B) Application that use the vectors of a map and calculate something: e.g to find a best path. The shortest connection, e.g A navighation system , etc.

Application for A) are usually less complex then that of B), because the vectors can be somewhat inacurate, have no conections, have small gaps, have no logic between the edges, etc. 

1) To only display a building map, you would only need a list of edges. (An edge is pair of coordinates (x1,y1) - (x2,y2). How ever you get that. E.g MapInfo Professional format mif/mid. 
Or even you could dispaly a pdf that contains the map of the builing. Right with the built in PDF View, (also with SVG but more difficult). 

Things get much more complicated if it is not a relative map, but also a map that is positioned with an reference coordinate system, like latitude/longitude (WGS84).
In that case you would use a Tool (mapInfoProfessional, to import AutoCad DXF Files, and apply 3 GPS measured reference points at the corner of the house, and convert that to LatLong WGS84 coordinates system.
With ios you cannot measure that 3 Points because you cannot average a position,  ios stops sending when you are standing still at one corner of the house.
You could try to extract the positions from a google earth satellite foto if you are living in a region where google Sattelite fotos have high resolution. (But  this might violate the license conditions of that Satellite Foto provider (Topic: derived data))

Finally you now have a list of edges in Lat Lon coordinate System.

For Displaying I personally would either do with 1) OpenGL) or 2) Quartz2D.

Now the Path finding part.

Probaly you need a second "map" that defines the possible paths inside the building.
This structure must be a connect graph (points with connected neighbours).
Computer games do it that way. (Some even allow you to display that path in developper  mode)

The path can be drawn, in a different layer of the floor plan. But  this path
 has higher requirements: No gaps are allowed, all must be perfect connected.

Call that layer "Path" and export it as own plan.
Now use only this path layer, and import, and create a graph of nodes with connect neighbours.

Use Dijkstra Algo to search for shortest path.