Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Crop Image
WhatsApp
Prashant Nimbare
12y
5.8
k
0
0
25
Blog
cropeImage.rar
CROP IMAGE
First design your form in like Following form
drag 1 picture box and button from ToolBox
on click event button write following Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static Image GetThumbnailImage(string path, int width, int height)
{
using (Image image = Image.FromFile(path))
{
Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCall);
return image.GetThumbnailImage(width, height, myCallback, IntPtr.Zero);
}
}
private static bool ThumbnailCall()
{
return false;
}
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.Image = GetThumbnailImage(@"C:\Users\Administrator\Desktop\roger.jpg", 200, 200);
}
}
}
run your application ., click on load button
you will get following output..
Crop Image
Up Next
Scan File From Scanner Using Flatbed And ADF With Windows Image Acquisition (WIA)
Ebook Download
View all
GitHub Copilot - Coding with Copilot
Read by 2.7k people
Download Now!
Learn
View all
Membership not found