mercredi 1 avril 2015

Avatars for users

I've had a look around here and so far I found many answers, but due to the fact that I'm new to MVC world I can't accomplish my task. After create a new MVC 5 application I'm simply trying to add an Avatar Image for my users, stored in the DATABASE.


So far can anyone please provide me which change I have to made to the default MODELS, CONTROL and VIEW to accomplish that? Thanks very much, it would be very appreciated. Thanks in Advance.


How do I change the opacity of an image when I hover of my text?

Hey I'm new here and I really need some help! I have my own website, please don't judge I am new to HTML and CSS.. The problem is that I don't know how to change the opacity when I hover over my text.. I want it to become lighter if I'm hovering over my text in the menu on the right. Does anyone know how I can do this? Right now It's only changing when I hover over the image itself, the text changes too, but I want it to both change at the same time and on the same object, so I hover over the text; text changes and images opacity changes. Please help me out! Luca


http://ift.tt/1aelVNP


How to show a loader until images are ready then show them

I am currently working on a website (http://ift.tt/1OY2RmC). In the galleries, when your computer loads an image, it actually loads on the left of my screen and, once fully loaded, displays on the center like it should. I don't like this, is there a way to show some sort of loader instead of the image then show it once it's ready ?


I have seen some solutions on the internet but none seemed to fit my needs or i wouldn't get it to work, can anyone help ?


Thank you.


Is it possible to make a torn paper effect on edges of a picture

Update 3


Hi guys, I updated the code (http://ift.tt/1NxJtcE) and now the edges look really like torn paper effect. It uses SVG by the way.


The Only problem is I don't know how to make the image as the background of the svg AT THE SAME TIME maintain the torn-paper-like edges.


Please have a look it. Any efforts are appreciated.




Update 2


It seems that it is impossible to achieve this effect without the help of PhotoShop(PS), so I would like to add PS as a part of solution.


I am not a PS expert, but from a quick thought, I think there are a few steps I need to do:



  • Use PS to create a torn paper "shell", let's say it's shell.png It should only have color on its edges and the color should be white; the inner area is transparent, so that we can place the picture in it.

  • Place shell.png on top of the picture, let's say banner.jpg, which means set the z-index of the div which uses shell as its background image to 1.

  • Use another div to contain the banner.jpg and set the z-index below the shell div.


Questions for this approach:




  • Is it responsive?




  • If not, is it possible to make it responsive? As I have to make it work properly on mobile devices.






I remember that I saw a beautifully designed website, there is a picture in the background and the edges of this picture look like torn paper effect which is fantastic!


I searched the similar questions here but it turns out that the effects in the answers are primitive, which are very simple rugged black lines.


What I want:



  1. I want this picture to be as wide as the device screen which means responsive.

  2. The edges of this picture look like torn paper.

  3. I will place this picture as a banner after the Top Navigation bar but before the content.


It should look like the white area in this picture. But in my case, I will need to fill in my picture to replace the white area.


enter image description here


Here is my code: Notice: in this code, the css uses an image as the edge, BUT that is not want I want. I just want the edges be the picture itself.(Is this possible?) So it will look like this one(the one on the right side, you can see that there is no white rugged edges) enter image description here



<div class="row">
<div id="letter" class="col-lg-12 col-md-12 col-sm-12 col-xs-12">

</div>
</div>

#letter { /*torn paper border*/
height:450px;
position:relative;
top:0;
bottom:0;
left:0;
right:0;
background-image:url('img/background.jpg');
background-size:cover;
opacity:0.8;
border-style: solid;
border-width: 40px 40px 40px;
-moz-border-image: url('http://ift.tt/1EUNiEb') 80 80 80 repeat;
-webkit-border-image: url('http://ift.tt/1EUNiEb') 80 80 80 repeat;
-o-border-image: url('http://ift.tt/1EUNiEb') 80 80 80 repeat;
border-image: url('http://ift.tt/1EUNiEb') 80 80 80 repeat;
}




Update


Hi guys,


I think I found something quite similar to what I am imagine. Here is the effect I want : enter image description here


How to compare two imagefile from two different files in python.

I would like to create a program that compares two images. I need to take images from two different folders and compare that images if they are same or not. Then I want to print out as same or different. For example file 1 will have image1 and image 2 and image 3 , etc then file 2 will have image1,image2 and image3 etc . I need to do this python. How do I do this? Can someone help me? I am new to programming and I am new to python as well. I have tried the solution as below, but it did not work. Comparing Image Files


How to use ajax to set the src of an image?

I need to set some headers when getting an image. The img src attribute does not allow this, so I'm using an XHR request to get the image. However, when I set the src attribute on the img tag after that request completes, it looks like the request is triggered again. Is there a way to cache the image and not trigger the second request?


Sample Code:



$(document).ready(function() {
var url = 'http://ift.tt/1BXHBTR'
var file = $.get(url);
file.then(function(data) {
$('#foo').attr('src', url);
});
});


JS Fiddle: http://ift.tt/1bK99XE


Note: my question is not about how to set the appropriate headers in the xhr request. My question is how to not trigger another GET from the setting of the src attribute and use the response from the XHR to display the image.


mardi 31 mars 2015

Add image and value to a panel?

I was able to add image to my panel with the following code, but now my problem is i need to retrieve some information from the image etc(key value)


Is that possible to add in a value to every image ?so I can get it when I need



foreach (System.Drawing.Image img in imagelist)
{
PictureBox imagePicBox = new PictureBox();
imagePicBox.Name = "image" + imagePanel.Controls.Count.ToString();


imagePicBox.Image = img;




imagePicBox.Size = imagePicBox.Image.Size;
imagePicBox.BackColor = Color.Black;
imagePicBox.SizeMode = PictureBoxSizeMode.StretchImage;
imagePicBox.BorderStyle = BorderStyle.FixedSingle;


imagePanel.Controls.Add(imagePicBox);



}