Im trying to make a screensaver whit the option to support single and multiple images. this is the code for single images where im trying to make it fit large images to screen but no matter what of these conversion types ive used
Round Rounds a floating point number to an integer
Trunc The integer part of a floating point number
it crashes whit - Incomplete types "Integer" and "Extended"
and then im wondering if its because im yousing delphi 2009 .. maybe i should bye the 2005 if thats still possible.
this is how my code looks
form2.Image1.BringToFront;
form2.Image1.Picture.LoadFromFile(edit1.Text); {Load the picture from the destination in edit1}
if form9.RadioButton1.Checked = true then {If stretxh is true then}
begin
form2.Image1.Stretch := true;
end
else {if stretch isn true}
begin
form2.Image1.Stretch := false;
if form9.RadioButton2.Checked = true then {IF resize large images = true}
begin
if form2.Image1.Picture.Height > screen.Height then {if the picture is bigger then screen}
begin
imageheightdiff := Trunc(form2.Image1.Picture.Height)- Trunc(screen.Height);
imageprocent := imageheight * Trunc(form2.Image1.Picture.height) / 100 ; {here it crashes and says Integer and extended - like if it havent been convertet to int above}
form2.image1.picture.height := imageprocent * 100 / Round(form2.Image1.Picture.Height);
form2.image1.picture.width := imageprocent * 100 / Round(form2.Image1.Width);
end
end;
end;
imageheightdiff & imageprocent is both integer variables
i hope someone can give me an answer cause i simple cant understand what im doing wrong...