I would like to build a facebook application similar to nametest or Meaww and almost succeeded to have my API calls to Facebook Graph API and return data from facebook. What makes me confused is the UI of aforementioned web applications. When you complete a test on Meaww or Nametests the result is represented to the user is in Image (Jpeg) format. I just don't know how they manage to convert HTML to an Image on the fly with all CSS styling and etc and how they return it back to the user as an Image? Is it possible to put this scenario into practice in ASP.NET MVC Too? If yes, So I need a hint to do it.
Below is an Image generated by Meaww as a result of playing a test.
Edit:
To be more specific...
I have a public async Task<ActionResult> FB_Analyse()
action in my controller which takes data from facebook via a Graph API call to facebook and then pass the data values to a model and at then end of Action returns a view as below:
public async Task<ActionResult> FB_Analyse()
{
var access_token = HttpContext.Items["access_token"].ToString();
if (!string.IsNullOrEmpty(access_token))
{
var appsecret_proof = access_token.GenerateAppSecretProof();
var fb = new FacebookClient(access_token);
#region FacebookUser Name and Picture plus other Info
//Get current user's profile
dynamic myInfo = await fb.GetTaskAsync("me?fields=first_name,last_name,link,locale,email,name,birthday,gender,location,age_range,about".GraphAPICall(appsecret_proof));
dynamic myinfojson = JsonConvert.DeserializeObject(myInfo.ToString());
ViewBag.UserName = myinfojson.name;
ViewBag.UserGender = myinfojson.gender;
//get current picture
dynamic profileImgResult = await fb.GetTaskAsync("{0}/picture?width=200&height=200&redirect=false".GraphAPICall((string)myInfo.id, appsecret_proof));
ViewBag.ProfilePictureURL = profileImgResult.data.url;
#endregion
dynamic myFeed = await fb.GetTaskAsync(
("me/feed?fields=likes{{name,pic_large}}")
.GraphAPICall(appsecret_proof));
string result = myFeed.ToString();
var jsonResult = JsonConvert.DeserializeObject<RootObject>(result);
var likes = new List<Datum2>();
foreach (var likeitem in jsonResult.data)
{
if (likeitem.likes != null)
{
foreach (var feedlikeitem in likeitem.likes.data)
{
likes.Add(feedlikeitem);
}
}
}
return view(likes);
}
Then In my view I have this simple <div>
tag with images as below:
<div class="imageWrapper" style="position: relative">
<img class="girl img-responsive" src="~/images/TestPictures/mHiDMsL.jpg" style="position: relative; z-index: 1;" />
<img src="@ViewBag.Picture" alt=.. width="100" height="100" style="position: absolute;left:80px; top: 80px;z-index: 10;" />
<img src="@ViewBag.ProfilePictureURL" alt=.. width="200" height="200" style="position: absolute;left:300px; top: 160px;z-index: 11;" />
</div>
As you can see I have three different <img>
tags. One is the background for two other images and two others is one Facebook user picture and second one is for facebook user friend's picture which both placed on the top of Background Image.
What I want to achieve is clear as blue sky. I want to combine these three pictures in one and then show it to the user as one image.
Please help I am lost.