Strange image stretching

knedla54

New Member
Hello.

example:
image1 is 200*200px and cNormal mode
image2 is 50*50px and cStretch mode
i have 200*200 picture directly on form

this code
image1.image=form.image
image2.image=image1.image

doesnt make the image stretch on 50*50, but stretches the whole form. interesting.
 

agraham

Expert
Licensed User
Longtime User
This happens because a Form treats its image differently to an Image control.

When an image is assigned to a Form it actually redraws the image onto an internal bitmap and when you access the Image property it returns a reference to this different, stretched, internal bitmap.

When an image is assigned to an Image control it does nothing to the actual bitmap but displays it according to its mode setting. When you access the Image property it returns the same reference it was given when the image was assigned so unlike a Form you get the same image returned.
 
Top