How to change the location of BackgroundImage in windows forms

0

I have a PictureBox object that has an image defined and by the way I put a background but I can not change the position of the background

 pb.ImageLocation = Directory.GetCurrentDirectory() + @"\..\..\img\copovazio.png"; 

I wanted to do something like pb.BackgroundImage.Location

This image is composed of one that makes the glass in transparent and a blue texture that makes the water. I wanted to move this texture underneath to make the water rise and fall

    
asked by anonymous 20.09.2017 / 18:15

1 answer

0

The image control is very limited, what I researched can be done is to overwrite the image drawing event like this:

private void myButton_Paint(object sender, PaintEventArgs e)
{
    e.Graphics.DrawImage(myImage, myButton.ClientRectangle);
}

So you can use TextAlign and Padding to control the movement of the image.

    
25.09.2017 / 20:10