Skip to main content


Follow lecture

Followlect is an Online learning site. The followlect give coding knowledge to novices developer. This site share content on SQL queries, Dot.Net, PHP, HTML,Python, C, C++, Asp.Net MSSQL Server, Oracle etc.      In this we give learners with coding along with example and explanation in steps by steps. The followlect will  guide how to develop and create software application. The followlect guide how to design database, how to create java application or create simple website etc. Followlect give content on most search topic google for example JOIN Operation in SQL,ALTER statement in sql, Select Sql statement , Search Engine Optimazation, the connection string etc.

for tamil guide, tn govt jobs, govt jobs in tamilnadu, tamilnadu government jobs visit
Recent posts

Trim Image to Equal Height and Width using Python

Trimming image using python:                            The following code contains to trim image in equal height and width size. To do this image pixel stored as array of pixel.
from PIL import Image import cv2 import numpy as np from matplotlib import pyplot as plt imagename = "pixg.png" img = cv2.imread(imagename, 0) # 0 params, for gray image height, width = img.shape[:2]  # image height and width img1 = Image.fromarray(img) print("height") print(height) print("width") print(width) array=np.array(img) d=np.delete(array,231,0) d=np.delete(d,231,0) d=np.delete(d,231,0) d=np.delete(d,230,0) img2=Image.fromarray(d) plt.imshow(img2,cmap = 'gray') print("After Trim") height, width = img2.size'trim.png') print("height") print(height) print("width") print(width)
Output:  height:234, width:230 After Trim: height:230, width:230
By using cv2 the img read the image from local file. The numpy np convert image into array of pixel…

Display image in Gray Scale Python

Gray Scale Image Python:    Python have option to convert image to Gray. The following code convert normal image to gray scale.

import cv2  # Read the main image  img_rgb = cv2.imread('mahindra.png') # Convert it to grayscale  img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)  cv2.imshow('Detected',img_gray) 
The package cv2 is used to read image from file.  img_rgb = cv2.imread('mahindra.png'). cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)  will convert rgb image to gray scale image. cv2.imshow('Detected',img_gray)  will display image.

Display Image from Database Asp.Net

Dynamic Image.         We can bind image dynamically in asp:image tag. This can be done by using data grid or grid view. Eval function is used to bind data from database. As Table shown below image_url field contain the location of image in server. In this example we use datagrid, the design page sample code below. The asp:image attribute ImageUrl bind value dynamically using Eval function. The Eval function is set with image_url field in image_tb table.
img_tb  id image_name image_url 1 img1 ~/images/img1.jpg
 <asp:DataGrid  ID="datagrid1" runat ="server"      font-names="Times New Roman" font-size="14px" ShowFooter="True" ForeColor="#333399" BorderWidth="1px" BorderColor="Black" BorderStyle="Solid"     AutoGenerateColumns="False"   AllowPaging ="true"  >          <Columns > <asp:TemplateColumn > <HeaderStyle HorizontalAlign="Center"></HeaderStyle…

Design Contact Us form in Asp.Net and Setting SMTP in Web.Config

Asp Code to Design Contact Form<div class="contact_form">             <div class="form_row">               <label class="contact"><strong>Name:</strong></label>               <asp:TextBox ID="txt_name" runat ="server" placeholder="Name" BackColor="#CCCCCC" BorderStyle="Solid" ></asp:TextBox>                  <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txt_name"                                     CssClass="field-validation-error" ErrorMessage="The user name field is required." />             </div>             <div class="form_row">               <label class="contact"><strong>Email:</strong></label>               <asp:TextBox ID="txt_email" runat ="server" placeholder="Email" Ba…

DropDownList in Asp.Net

Asp.Net DropDownList    Using DropDownList user can choose item from the list of item. To DropDownList include the tag <asp:DropDownList> in Asp page. <asp:DropDownList ID="dd_year" runat ="server" >                  <asp:ListItem  Value ="0">Select</asp:ListItem>                  <asp:ListItem  Value ="1">I</asp:ListItem>                  <asp:ListItem Value="2">II</asp:ListItem>                  <asp:ListItem Value="3" >III</asp:ListItem>                                     </asp:DropDownList> The subtag <asp:ListItem > will add option, the attribute Value add integer value, for our convenience to use in code behind page.  TThe above dropdownlist static. Default Option in DropDownList Asp.Net<asp:RequiredFieldValidator id="rr_year" runat ="server" ForeColor ="red" ErrorMessage ="Select Year" ControlToValidate ="dd…

Asp.Net Radio Button

How to add RadioButton in Asp.Net ?    RadioButton allow to choose one  items from list of related items. To add radio button simply include <asp:RadioButton> tag in Asp page.
<div>  <asp:RadioButtonList ID="ratiobutton1" runat ="server" >              <asp:ListItem >85 to 100%</asp:ListItem> <asp:ListItem Value ="1">70 to 84%</asp:ListItem>  <asp:ListItem Value ="2">55 to 69%</asp:ListItem> <asp:ListItem Value ="3">30 to 54%</asp:ListItem> <asp:ListItem Value ="4">Below 30%</asp:ListItem>          </asp:RadioButtonList>  <div> The subtag <asp:ListItem > will add radio option, the attribute Value add integer value, for our convenience to use in code behind page.   In code behind page(Vb.Net) ratiobutton1.SelectedItem.ToString() return selected ratio option  string value. ratiobutton1.SelectedValue() return selected selected ratio option integer…

Form Validators in Asp.Net

Form Validation in Asp.Net.    The Form validation control are used to control  user to enter valid data. It also give warning to user for invalid data entry. The validation control  validate data entry in client side. It prevent user to store invalid, inappropriate and inconsistency data in database.   ASP.NET Validation Types. RequiredFieldValidatorRangeValidatorCompareValidatorRegularExpressionValidatorCustomValidatorValidationSummaryRequiredFieldValidator     Normally it is used along with the textbox or user input control. It make sure that the textbox is not empty. The user must enter value to textbox otherwise it warn user to enter value to textbox. for example <asp:TextBox ID="txt_name"   runat ="server" ></asp:TextBox>                    <asp:RequiredFieldValidator ID="rfv_name" runat ="server"  ControlToValidate ="txt_name" ForeColor ="red" ErrorMessage ="Enter Your Name" ></asp:RequiredFie…