Don’t ask me why but i can’t use this method because I need to create 2 image objects to make it work.
I want to be able to resize a single Image object without needing to create another one. Is this possible and how?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, this is not possible. The height and width of an
Imageobject are fixed at the time theImageobject is constructed. This limitation exists in the underlying GDI+ API.If you do not need to modify the
Image, perhaps it is acceptable to scale it every time it is rendered. For example, in aControl.Paintevent, you can useGraphics.DrawImageto render it directly onto thePaintEventArgs.Graphicscontext. This will allow you to draw the image at different sizes without creating additionalImageobjects.