• Twitter
  • Facebook
  • Google+
  • Instagram
  • Youtube

About me

Let me introduce myself


A bit about me

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Profile

Deepak Bhagya

Personal info

Deepak Bhagya

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.

Birthday: 21 SEP 1986
Phone number: +(12) 34 567 89
Website: www.dakshbhagya.com
E-mail: Me@dakshbhagya.com

RESUME

Know more about my past


Employment

  • 2015-future

    Mutation Media @ Web Developer

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2011-2014

    Websoham @ Exclusive Admin

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2009-2011

    Templateclue.com @ Lead Developer

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Education

  • 2015

    University of Engineering @Level

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2013-2014

    College of Awesomeness @ passed

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2009-2013

    College of Informatics @ graduated

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Skills & Things about me

photographer
86%
html & css
Punctual
91%
illustrator
Web Developer
64%
wordpress

Portfolio

My latest projects


Showing posts with label Resize Image. Show all posts
Showing posts with label Resize Image. Show all posts

Friday, April 11, 2008

How to create Image reflection in Asp.Net

How to create Image reflection in Asp.Net
=======================================

Method :
---------

public Image DrawReflection(Image _Image, Color _BackgroundColor, int _Reflectivity)
{
// Calculate the size of the new image
int height = (int)(_Image.Height + (_Image.Height * ((float)_Reflectivity / 255)));
Bitmap newImage = new Bitmap(_Image.Width, height, PixelFormat.Format24bppRgb);
newImage.SetResolution(_Image.HorizontalResolution, _Image.VerticalResolution);

using (Graphics graphics = Graphics.FromImage(newImage))
{
// Initialize main graphics buffer
graphics.Clear(_BackgroundColor);
graphics.DrawImage(_Image, new Point(0, 0));
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
Rectangle destinationRectangle = new Rectangle(0, _Image.Size.Height, _Image.Size.Width, _Image.Size.Height);

// Prepare the reflected image
int reflectionHeight = (_Image.Height * _Reflectivity) / 255;
Image reflectedImage = new Bitmap(_Image.Width, reflectionHeight);

// Draw just the reflection on a second graphics buffer
using (Graphics gReflection = Graphics.FromImage(reflectedImage))
{
gReflection.DrawImage(_Image, new Rectangle(0, 0, reflectedImage.Width, reflectedImage.Height),
0, _Image.Height - reflectedImage.Height, reflectedImage.Width, reflectedImage.Height, GraphicsUnit.Pixel);
}
reflectedImage.RotateFlip(RotateFlipType.RotateNoneFlipY);
Rectangle imageRectangle = new Rectangle(destinationRectangle.X, destinationRectangle.Y,
destinationRectangle.Width, (destinationRectangle.Height * _Reflectivity) / 255);

// Draw the image on the original graphics
graphics.DrawImage(reflectedImage, imageRectangle);

// Finish the reflection using a gradiend brush
LinearGradientBrush brush = new LinearGradientBrush(imageRectangle,
Color.FromArgb(255 - _Reflectivity, _BackgroundColor),
_BackgroundColor, 90, false);
graphics.FillRectangle(brush, imageRectangle);
}

return newImage;
}

How to Use It (Testing)
-----------------------------

Response.ContentType = "image/jpeg";

Image objImage = Image.FromFile(Server.MapPath("Image.jpg"));

Image objImage2 = this.DrawReflection(objImage, Color.White, 80);

objImage2.Save(Response.OutputStream, ImageFormat.Jpeg);


That's it !
Hope you will like it.

Tuesday, January 29, 2008

Download Image in Asp.Net

Download Image in Asp.Net
=======================

string ImageFile = Server.MapPath("Hello.jpg");
System.Drawing.Image objImage = System.Drawing.Bitmap.FromFile(ImageFile);
Response.Clear();
Response.ClearContent();
Response.ContentType = "images/jpeg";
Response.AddHeader("Content-Disposition", "attachment; filename=Image.jpg;");

MemoryStream objMem = new MemoryStream();
objImage.Save(objMem, ImageFormat.Jpeg);
objMem.WriteTo(Response.OutputStream);
//objImage.Save(Response.OutputStream, ImageFormat.Jpeg);
Response.End();

That's It !!
Hope you will like it.

Monday, March 5, 2007

Resize Image With Perfect Ratio with [Height x Width] in Asp.Net

Use Namespace
================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;

Code Behind
============

System.Drawing.Image img;
img = System.Drawing.Image.FromFile(cStrTextFileName);

Bitmap bmp = new System.Drawing.Bitmap(img);

System.Drawing.Image.GetThumbnailImageAbort imgCallBack = new System.Drawing.Image.GetThumbnailImageAbort(CallBackMethod);

//System.Drawing.Bitmap bmpThumbnail = ((Bitmap)bmp.GetThumbnailImage(62, 48, imgCallBack, IntPtr.Zero));

/******************/
int[] HWRation = ResizeImageWithRatio(img, 120, 60);
/******************/

System.Drawing.Bitmap bmpThumbnail = ((Bitmap)bmp.GetThumbnailImage(HWRation[0], HWRation[1], imgCallBack, IntPtr.Zero));

//System.Drawing.Bitmap bmpThumbnail = ((Bitmap)bmp.GetThumbnailImage(120, 60, imgCallBack, IntPtr.Zero));
bmpThumbnail.SetResolution(img.HorizontalResolution, img.VerticalResolution);
img.Dispose();

bmpThumbnail.Save(Server.MapPath("images/logo/") + Session["userid"].ToString() + strExtension);

imgImage.Src = "images/logo/" + Session["userid"].ToString() + strExtension;

// Upload New File..
// fileImage.PostedFile.SaveAs(MapPath("logo/") + Session["userid"].ToString() + strExtension);

Image Resize Function
=====================
int[] ResizeImageWithRatio(System.Drawing.Image img, int MaxWidth, int MaxHeight)
{
int[] newHeightWidth = new int[2];

if (img.Width > MaxWidth || img.Height > MaxHeight)
{
double widthRatio = (double)img.Width / (double)MaxWidth;
double heightRatio = (double)img.Height / (double)MaxHeight;
double ratio = Math.Max(widthRatio, heightRatio);
int newWidth = (int)(img.Width / ratio);
int newHeight = (int)(img.Height / ratio);

newHeightWidth[0] = newWidth;
newHeightWidth[1] = newHeight;

}
else
{
newHeightWidth[0] = img.Width;
newHeightWidth[1] = img.Height;
}
return newHeightWidth;
}

public bool CallBackMethod()
{
return false;
}

Services

What can I do


Branding

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Web Design

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque.

Graphic Design

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Development

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Photography

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

User Experience

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

Contact

Get in touch with me


Adress/Street

12 Street West Victoria 1234 Australia

Phone number

+(12) 3456 789

Website

www.johnsmith.com