View Single Post
  #369  
Old 05-07-2013, 04:56
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,749
Thanks: 2,170
Thanked 11,206 Times in 2,307 Posts
Razor12911 is on a distinguished road
hmm, It works.

Might consider adding this to my installer

function ImgPBCreate(hParent :HWND; bk, pb :ansistring; Left, Top, Width, Height :integer):TImgPB;
begin
Result.Left:=Left+1;
Result.Top:=Top+1;
Result.Width:=Width-2;
Result.Height:=0;
Result.MaxHeight:=Height-2;
if Length(pb)>0 then Result.img1:=ImgLoad(hParent,pb,Result.Left,Result .Top,0,Result.Height,True,False) else Result.img1:=0;
if Length(bk)>0 then Result.img2:=ImgLoad(hParent,bk,Left,Top,Width,Hei ght,True,False) else Result.img2:=0;
end;

procedure ImgPBSetPosition(var PB :TImgPB; Percent :Extended);
begin
if PB.img1<>0 then begin
NewHeight:=Round(PB.MaxHeight*Percent/100);
if PB.Height<>NewHeight then begin
PB.Height:=NewHeight;
ImgSetPosition(PB.img1,PB.Left,PB.Top,PB.Width,PB. Height);
end;
end;
end;

find

NewWidth and MaxWidth

and change them to

NewHeight and MaxHeight

they are under var