Thursday, August 31, 2006

Tutorials on Enterprise Library

These days i got a chance to start working with one of the tool witch i was dreaming to work with.Enterprise Library.When i am Searching for Tutorials for Enterprise Library i found Some great Great articles.So i thought to share them with you all.

The Enterprise Library Data Access Application Block

Online Tutorials about Enterprise Library

Using the Enterprise Library Data Access Block for .NET 2.0

And some Links was available in Angelos Petropoulos' WebLog

(archive Tutorials on using Enterprise Library )

Saturday, August 26, 2006

Upuli got Married


One of ma good friend Upuli got Married y’day.wedding was @ koggala beach Hotel.

Hmmm very nice to see you as a bride buddy. Hope you will get all the happy things in your new life.

Best wishes to both of you !!!!.


The best Is yet to come lu ne????

Congrats..... !!!

Wednesday, August 23, 2006

I just started photo sharing

I started my old habit again.but still didnt feel much comfortable on it.anyway hope you all will help me to improve.i always welcome your comments on it.I just started my photosharing at flickr.com.And click here to go to my photo sharing at flickr.com.


cheers

Tuesday, August 22, 2006

What can we do for this?As a Sri Lankan








Here are some pics witch i have got from one of my friend.can u understand how much Tamil people are in Canada supporting to establish "EELAM" as their homeland. See how our flag has been disgraced by Tamils can we call them as Sri Lankans ?????

Wednesday, August 02, 2006

Creating thumbnail Image(VB.NET)

I wanted To Create a thumbnail Image from Original Picture And save it in Employee Data.I used image.GetThumbnailImage function to sort this out.So i thught to Publish it here ,it will be a Help for someone else.



' Photo path(Actual path to Uploaded Pic)

Public Shared Function CreateThumbnail(ByVal imagePath As String, ByVal Folder As String) As Boolean

Dim createdThumbnail As Boolean = False

Dim thumbnail As Image

Dim image As Bitmap



Try

' get full path to the thumbnail image

Dim thumbnailPath As String = Path.Combine(Folder, GetThumbnailName(imagePath))



' check thumbnail already exist

If Not File.Exists(thumbnailPath) Then

image = New Bitmap(imagePath)

' create thumbnail image

thumbnail =GetThumbnail(image, 120)



' save thumbnail

thumbnail.Save(thumbnailPath, ImageFormat.Jpeg)



createdThumbnail = True

End If

Catch ex As Exception

' an error occurred, return null

Finally

' clean up

If Not thumbnail Is Nothing Then thumbnail.Dispose()

If Not (image Is Nothing) Then image.Dispose()

End Try



Return createdThumbnail

End Function



Public Shared Function GetThumbnail(ByVal image As Bitmap, ByVal longestSide As Integer) As Image

Dim thumbnail As Image



Try

' determine scale of the image

Dim scale As Single = CSng(IIf(image.Width > image.Height, _

longestSide / image.Width, longestSide / image.Height))



Dim width As Integer = CInt(image.Width * scale)

Dim height As Integer = CInt(image.Height * scale)



thumbnail = image.GetThumbnailImage(width, height, Nothing, IntPtr.Zero)

Catch ex As Exception

' an error occurred, return null

End Try



Return thumbnail

End Function





Generated using PrettyCode.Encoder