can you explain how increase, decrease height and width after drag image in Picture Box. and Multiple Image in Single Image Box Or Panel etc. Thanks For Your Tutorial
Before you enter the below code, set the size mode of pbMain to Normal by adding picMain.SizeMode = PictureBoxSizeMode.Normal; to the form load event handler. private void frmMain_Load(object sender, EventArgs e) { pbMain.AllowDrop = true; pbMain.SizeMode = PictureBoxSizeMode.Normal; } code to resize pbMain: --------------------------------------------------- private void pbMain_DragDrop(object sender, DragEventArgs e) { var bmp = (Bitmap)e.Data.GetData(DataFormats.Bitmap); pbMain.Image = bmp; pbMain.Height = bmp.Height; pbMain.Width = bmp.Width; } Once you execute the above code, the size of pbMain gets dynamically updated based on the size of image you drag and drop. Thank you for you kind viewing and posting your doubt to me. If you want any further video on any programming language ask me. If I know that I will try to make tutorial on that.
Allowdrop property is missing in picturebox? How to include this property
Thank you, it help a lot.
You are welcome! I'm glad. I was able to help you out :) If you haven't subscribed yet, please do so to help me grow my channel.
THNAKS!
If bitmap error say that bitmap is a class types cannot be used as an expression? How to fix it?
Thank you thank you 😃😃😃
You are welcome :)
Thank you 😊 goob help.
Thank you :)
can you explain how increase, decrease height and width after drag image in Picture Box. and Multiple Image in Single Image Box Or Panel etc.
Thanks For Your Tutorial
Whether you asking how to resize the size of picture box to the size of image once we drag and drop?
after drag in Main Picture Box
Before you enter the below code, set the size mode of pbMain to Normal by adding
picMain.SizeMode = PictureBoxSizeMode.Normal;
to the form load event handler.
private void frmMain_Load(object sender, EventArgs e)
{
pbMain.AllowDrop = true;
pbMain.SizeMode = PictureBoxSizeMode.Normal;
}
code to resize pbMain:
---------------------------------------------------
private void pbMain_DragDrop(object sender, DragEventArgs e)
{
var bmp = (Bitmap)e.Data.GetData(DataFormats.Bitmap);
pbMain.Image = bmp;
pbMain.Height = bmp.Height;
pbMain.Width = bmp.Width;
}
Once you execute the above code, the size of pbMain gets dynamically updated based on the size of image you drag and drop.
Thank you for you kind viewing and posting your doubt to me.
If you want any further video on any programming language ask me. If I know that I will try to make tutorial on that.
10/10
Thanks so much for watching! I'm glad. I was able to help you out :) If you haven't subscribed yet, please do so to help me grow my channel.