c# - Thumbnails asp.net -
I am trying to write an application that clicks a button to view images as thumbnails I have a Dalit in my model popup from a folder in a modal popup. But from there I do not know where to go I have already tried 4guysfromrolla solution, but it was not what I was looking for. How do I set images as thumbnails? I already have the following ....
string () = directory in the form of slow files. File files for each file in the form of gate files (server.mappath ("~ / folder1 / folder2 /"), "* .jpg") in the file as string. Shuttle (file. Last indexoff ("/") + 1, file. Length) 'Response Write (file & amp; & lt; br & gt; ") file = file & dim image = new image (as image) & image.ImageUrl = file image.ight = 50 Image.Width = 50 Me.Controls.Add (image) Next
Edit: New Question
I resize the images in JavaScript onmouseover .
image.Attributes.add ("
Is it possible to do this here?
& lt; ASP: data list id = "dl_thumbs" runat = "server"> Lt; img src = "& lt; % # Eval ("imageUrl")%> "height =" 50 "width =" 50 "heading =" & lt;% # Eval ("imageTitle")%> "Alt =" & lt;% # Eval ("imageAlt")%> /> Private Zero InitData (string folder) {var files = Directory.GetFiles (Server. MapPath (folder)); Var images = files.Select (i = & gt; new {imageUrl = folder} path. Gate filename (i), imageTitle = path. GetFileName (i), imageAlt = Path. GetFileName (i)}); Dl_thumbs.DataSource = Picture; Dl_thumbs.DataBind (); }
How do I save the image to a folder?
Thumbnails are usually processed and are customized versions of the original file.
The original file will be processed 500x500, then the thumb will be processed up to 50x50.
You must have 2 (or more images).
MyfavImageName.jpg
myfavImageName.thumb.jpg
or add another folder [thumb]
/ folder1 / folder2 / MyfavImageName.jpg
/ folder1 / folder2 / thumbs / MyfavImageName.jpg
You can also use the path to get the file name. Its low error prone:
file name = path. GetFileName (file);
Comments
Post a Comment