Strange title, but it's the most accurate thing I could think of.
I'm making a small program that can convert an image to different things. (Formats, and hex.) I've run into a problem with displaying the image, however.
SCAR Code:
procedure TForm1.Button1Click(Sender: TObject);
var
PicH, PicW: Integer;
begin
OpenPictureDialog1.Execute;
Form2.Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
Form2.Caption := ExtractFileName(OpenPictureDialog1.FileName);
PicH := Form2.Image1.Picture.Height;
PicW := Form2.Image1.Picture.Width;
Form2.Image1.Height := PicH;
Form2.Image1.Width := PicW;
Form2.ClientHeight := PicH;
Form2.ClientWidth := PicW;
Form2.HorzScrollBar.Visible := False;
Form2.VertScrollBar.Visible := False;
Form2.Visible := True;
end;
It's suppose to show another form that holds the image selected. It works with some images, but with others, it adds about fifteen pixels from the bottom of Image1 to the bottom of the form's window area. (Client area? Not sure what it's called...)
I'm completely stumped. I've tried subtracting fifteen pixels from ClientHeight, but that doesn't work. That just adds those fifteen pixels to ClientWidth, for some reason...
Anyways, I'm hoping you can help me. Tell me what I'm doing wrong
-Mike
Edit: Never mind. Fixed