Click here to Skip to main content
15,894,955 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Morning ,
I have create one console application , its runs by schedule.
Now i have one facility of email , in that i am sending one image which uses "http://maps.googleapis.com/maps/api/staticmap?center=........" this path and its X any Y centers are coming through my console application .

Now this googlemap is my main image , in that i want to put marker image(my image which is in my console application and marker image will be put according to X and Y center).

Main image is google map , in that i want to my marker image (image within image).

I know there is AlternateView and LinkedResource.
i used that like this way
e.g. linkedResource.ContentId = "image1";

C#
string imgURL = "http://maps.googleapis.com/maps/api/staticmap?center=X,Y&size=640x450&markers=icon:\"cid:image1\"?color:blue|label:v|X,Y&sensor=false";

// this mail message string
string mailMessage += "<a href=@"google.com">";

mailMessage += "<img alt=\"Enable image to view Map\" src=" + imgURL + " />";

mailMessage += "</a><br /><br/>";

but its not working .Marker image is displayed in attachment and i want to put it (marker image) in first image say google map.

Previously this app was run fine , because marker image was on server , but now i dont want to use server image , i want to use image , that is/will be in console application.

If any one have any idea let me.

Thank you.
Posted
Updated 14-Jul-14 21:08pm
v2

1 solution

It is apparent that first you should prepare the image you want, which is a combination of two images, one on top of another (foreground image on a background). You can easily do it using System.Drawing.

The key is: to draw on some bitmap, you should create a bitmap, and than obtain an instance of System.Drawing.Graphics from this bitmap and draw using this instance. This is how: http://msdn.microsoft.com/en-us/library/system.drawing.graphics.fromimage(v=vs.110).aspx[^].

And, to draw an image, use one or more of the System.Drawing.DrawImage methods:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics%28v=vs.110%29.aspx[^].

It also depends on these properties:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.compositingmode%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.compositingquality%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.interpolationmode%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900