9.1.11

Save Image as small, medium and large

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Drawing;
using System.Web.UI;
using System.Drawing.Imaging;


namespace Ecommerce.BLL
{
public class ImagesManager
{
///
/// This method is used to upload images according to height width
///

///
///
///
///
public void Bll_UploadImages(string FileName,int width, int height, string SaveName)
{

Bitmap oCounter;
Graphics oGraphics;
oCounter = new Bitmap(width ,height);
oGraphics = Graphics.FromImage(oCounter);
FileStream fs = new FileStream(FileName, FileMode.OpenOrCreate);
fs.ReadByte();
Bitmap objImage = new Bitmap(fs);
oGraphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
oGraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
oGraphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
oGraphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
oGraphics.DrawImage(objImage, 0, 0, width, height);
oCounter.Save(SaveName);
objImage.Dispose();
oCounter.Dispose();
fs.Dispose();
File.Delete(FileName);

}
}
}
================================================================
protected void imgSubmit_Click(object sender, ImageClickEventArgs e)
{

if (ViewState["ImageID"].ToString() == "")
{
objBol.Products_imageID = -1;
}
else
{
objBol.Products_imageID = Convert.ToInt32(ViewState["ImageID"]);
}
objBol.ProductsID = Convert.ToInt32(ViewState["ProductsID"]);
objBol.ColourID = Convert.ToInt32(DropColour.SelectedValue);
objBol.Colour_name = DropColour.SelectedItem.Text;
objBol.Icon_image = "";
objBol.Medium_image = "";
objBol.Large_image = "";
objBol.default_style = false;
int retval= objBll.BLL_InsUpdProductsImages (objBol);
if (retval > 0)
{
string strImagePath, strSavepath;

strImagePath = retval.ToString() + "1.jpg";
strSavepath = retval.ToString() + ".jpg";
if (ProductImageUpload .FileName != "")
{
// small icon
string strsmalliconPath = Server.MapPath("~/ProductsImages/Small/" + strImagePath);
string strsmalliconsavePath = Server.MapPath("~/ProductsImages/Small/" + strSavepath);
ProductImageUpload.SaveAs(strsmalliconPath);
objImg.Bll_UploadImages(strsmalliconPath, 50, 50, strsmalliconsavePath);
//icon image
string striconPath = Server.MapPath("~/ProductsImages/Icon/" + strImagePath);
string striconsavePath = Server.MapPath("~/ProductsImages/Icon/" + strSavepath);
ProductImageUpload.SaveAs(striconPath);
objImg.Bll_UploadImages(striconPath, 120, 120, striconsavePath);
//medium image
string strMediumPath = Server.MapPath("~/ProductsImages/Medium/" + strImagePath);
string strMediumsavePath = Server.MapPath("~/ProductsImages/Medium/" + strSavepath);
ProductImageUpload.SaveAs(strMediumPath);
objImg.Bll_UploadImages(strMediumPath,288, 360, strMediumsavePath);
//large image
string strLargePath = Server.MapPath("~/ProductsImages/Large/" + strImagePath);
string strLargesavePath = Server.MapPath("~/ProductsImages/Large/" + strSavepath);
ProductImageUpload.SaveAs(strLargePath);
objImg.Bll_UploadImages(strLargePath, 576, 720, strLargesavePath);
}
}
DisplayProductsImages();
ViewState["ImageID"] = "";
}

28.12.10

Adding a Javascript onclick event to a Radio Button List Item on DataBound

http://www.siphilp.co.uk/archive/2007/11/08/adding-a-javascript-onclick-event-to-a-radio-button-list.aspx

Rad-Combobox databind at Clientside using javascript

http://www.telerik.com/community/forums/aspnet-ajax/combobox/rad-combobox-databind-at-clientside-using-javascript.aspx

JavaScript Split String Function
http://programming.top54u.com/Samples/Javascript/String-Object/Split-String-Function/Default.aspx

25.12.10

rotate images

http://fancybox.net/

http://www.huddletogether.com/projects/lightbox2/

http://www.efectorelativo.net/laboratory/noobSlide/

carousse:
http://www.paulvanroekel.nl/picasa/caroussel/
http://demo.tutorialzine.com/2010/11/rotating-slideshow-jquery-css3/

http://www.1stwebdesigner.com/design/fresh-jquery-image-gallery-display-solutions/

22.12.10

jquery zoom and Thumbnail rotate

http://leandrovieira.com/projects/jquery/lightbox/#

http://www.javascriptphotogallery.com/jquery-image-gallery-zoom-asp-net.html

http://www.professorcloud.com/mainsite/cloud-zoom.htm

http://www.dfc-e.com/metiers/multimedia/opensource/jquery-fancyzoom/

http://www.ajax-zoom.com/index.php?cid=home

http://jquerylightbox.com/asp-net-mvc-jquery-popup.html

http://www.dynamicdrive.com/dynamicindex4/imagemagnify.htm
http://www.dynamicdrive.com/dynamicindex4/imagemagnify.htm
http://www.ajax-zoom.com/demo/magento/index.php/ottoman.html


http://www.catosplace.net/jquery_sandbox/galleryview/index.html

http://web.enavu.com/tutorials/10-best-jquery-gallery-and-slider-plugins/

http://demos.telerik.com/aspnet-ajax/rotator/examples/gallery/defaultcs.aspx

13.12.10

iframe youtube

http://www.dynamicdrive.com/forums/archive/index.php/t-47803.html

12.12.10

Dynamically Output A List of YouTube Videos In ASP.NET

http://surinder.computing-studio.com/post/2009/05/Dynamically-Output-A-List-of-YouTube-Videos-In-ASPNET.aspx

AI39si50OOMnhiZKAqaYo9EaxOH900UCbvwkGbUVDhfxuOjFEg7wR2gC8nXsoZuc_MfHvBznmrzL5Qn-L30AA6jKkXL6IKoANA


http://code.google.com/apis/youtube/2.0/developers_guide_dotnet.html

1.11.10

Download file In RadajaxPanel

http://www.telerik.com/help/aspnet-ajax/ajxdownload.html