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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Left/Right Gap in TImageEnMView?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
cpstevenc Posted - Nov 07 2012 : 09:14:46
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?
6   L A T E S T    R E P L I E S    (Newest First)
cpstevenc Posted - Nov 15 2012 : 15:28:50
Thanks. The HorizBorder fixed it for me.
w2m Posted - Nov 13 2012 : 13:57:54
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

cpstevenc Posted - Nov 13 2012 : 12:56:51
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

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

William Miller
cpstevenc Posted - Nov 13 2012 : 12:09:33
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.

w2m Posted - Nov 07 2012 : 11:23:18
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