ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Left/Right Gap in TImageEnMView?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

cpstevenc

USA
125 Posts

Posted - Nov 07 2012 :  09:14:46  Show Profile  Reply
Using 4.1.0 TImageEnMView with multiple thumbnail images.

I see uppergap and bottomgap properties, but nothing for the side gap?

Pictures to me are to bunched up together. Like to put a bit of spacing between them.

Any tricks?

w2m

USA
1990 Posts

Posted - Nov 07 2012 :  11:23:18  Show Profile  Reply
Change the ImageEnMView1.ThumbHeight and the ImageEnMView1.ThumbWidth to change the spacing between images. To get the correct spacing between images you may have to adjust both properties.

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

cpstevenc

USA
125 Posts

Posted - Nov 13 2012 :  12:09:33  Show Profile  Reply
This does not seem to help? I have the black border that goes all around each thumbnail. Changing the size to smaller just makes the picture smaller, but the images still have only 3-4 pixel gap between its neighbors.

Go to Top of Page

w2m

USA
1990 Posts

Posted - Nov 13 2012 :  12:21:24  Show Profile  Reply
Did you adjust the Thumbheight and ThumbWidth? Both have to be changed. Show your code... images do not help much.

William Miller
Go to Top of Page

cpstevenc

USA
125 Posts

Posted - Nov 13 2012 :  12:56:51  Show Profile  Reply
right now I am just using a fillfromdirectory.. and then a loop to
change the text on top/bottom. Nothing to complicated yet.

Using object inspector to set the values.

That was with thumbheight/width set to 100.. i changed both to 50 and here is what it looks like now

Go to Top of Page

w2m

USA
1990 Posts

Posted - Nov 13 2012 :  13:57:54  Show Profile  Reply
Put 2 TEdit's somewhere on your form and name one ThumbHeight1 and the other ThumbWidth1, Add 2 UpDown components next to the TEdit's and associate them to the TEdits. Then add this code:
procedure TForm1.ThumbHeight1Change(Sender: TObject);
begin
  ImageEnMView1.ThumbHeight := StrToIntDef(ThumbHeight1.Text, 75);
  ImageEnMView1.Update;
end;

procedure TForm1.ThumbWidth1Change(Sender: TObject);
begin
  ImageEnMView1.ThumbWidth := StrToIntDef(ThumbWidth1.Text, 125);
  ImageEnMView1.Update;
end;


The spacing is controlled by the width of the ImageEnMView, the ThumbWidth and ThumbHeight. When you adjust the ThumbWidth and ThumbWHeight the spacing between the thumbnail will change.

You can also control the specing with HorzBorser and VertBorder properties. In your case with one row of images it works nicely as well:
procedure TForm1.HorzBorder1Change(Sender: TObject);
begin
  ImageEnMView1.HorizBorder := StrToIntDef(HorzBorder1.Text, 4);
  ImageEnMView1.Update;
end;

Also you do not have to use a loop to set the caption properties. Just put some code in the
the ImageEnMView1BeforeImageDraw event:
procedure TForm1.ImageEnMView1BeforeImageDraw(Sender: TObject; idx, Left, Top: Integer;
  Canvas: TCanvas);
var
  iDimensions: string;
  iBitDepth: integer;
  iColors: string;
begin
  if FileExists(ImageEnMView1.MIO.Params[idx].FileName) then
  begin
    iDimensions := IntToStr(ImageEnMView1.MIO.Params[idx].Width) + ' x ' +
      IntToStr(ImageEnMView1.MIO.Params[idx].Height);
    iBitDepth := ImageEnMView1.MIO.Params[idx].BitsPerSample *
      ImageEnMView1.MIO.Params[idx].SamplesPerPixel;
    if iBitDepth = 32 then
      iColors := ' RGBA' + IntToStr(iBitDepth) + '-bit'
    else
      iColors := ' RGB' + IntToStr(iBitDepth) + '-bit';
    ImageEnMView1.ImageTopText[idx].Caption := iDimensions + iColors;
    ImageEnMView1.ImageInfoText[idx].Caption := 'DPI: ' +
      IntToStr(ImageEnMView1.MIO.Params[idx].Dpi);
    ImageEnMView1.ImageBottomText[idx].Caption :=
      ExtractFilename(ImageEnMView1.MIO.Params[idx].FileName);
  end;
end;


The BeforeImageDraw event is executed after the ImageEnMView is filled, for each thumbnail in the ImageEnMView.
William Miller

Go to Top of Page

cpstevenc

USA
125 Posts

Posted - Nov 15 2012 :  15:28:50  Show Profile  Reply
Thanks. The HorizBorder fixed it for me.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: