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
 ImageEnMView: what is the current selected image?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

skippix

USA
68 Posts

Posted - Aug 25 2013 :  04:37:18  Show Profile  Reply
i want to allow users to toggle between grid view and single view by double-clicking on the ImageEnMView. the following code doesn't work:

procedure Tfb13Main.ImageEnMView1DblClick(Sender: TObject);
var i: Integer;
begin
if (ImageEnMView1.DisplayMode = mdGrid) then
begin
i := ImageEnMView1.SelectedImage;
ImageEnMView1.DisplayMode := mdSingle;
ImageEnMView1.ReloadImage(i);
ImageEnMView1.ThumbWidth := ImageEnMView1.Width;
ImageEnMView1.ThumbHeight := ImageEnMView1.Height;
end
else
begin
ImageEnMView1.DisplayMode := mdGrid;
ImageEnMView1.ThumbWidth := TrackBar1.Position;
ImageEnMView1.ThumbHeight := TrackBar1.Position;
end;
end;

also, when i scale up the image, it's pixelated. what do i need to do to get the larger view to look nice?

what do i need to do to make this work? thanks!

w2m

USA
1990 Posts

Posted - Aug 25 2013 :  05:47:37  Show Profile  Reply
procedure TForm1.ImageEnMView1DblClick(Sender: TObject);
var
  i: Integer;
begin
  if (ImageEnMView1.DisplayMode = mdGrid) then
  begin
    i := ImageEnMView1.SelectedImage;
    ImageEnMView1.DisplayMode := mdSingle;
    ImageEnMView1.ThumbWidth := ImageEnMView1.Width;
    ImageEnMView1.ThumbHeight := ImageEnMView1.Height;
    {Specifies the visible image when TImageEnMView.DisplayMode is
    mdSingle or TImageEnMView.Playing is True.}
    ImageEnMView1.VisibleFrame := i;
  end
  else
  begin
    i := ImageEnMView1.VisibleFrame;
    ImageEnMView1.DisplayMode := mdGrid;
    ImageEnMView1.ThumbWidth := TrackBar1.Position;
    ImageEnMView1.ThumbHeight := TrackBar1.Position;
    ImageEnMView1.SelectedImageAlwaysVisible := True;
    ImageEnMView1.SelectedImage := i;
  end;
end;

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

skippix

USA
68 Posts

Posted - Aug 25 2013 :  06:12:24  Show Profile  Reply
excellent on the dbl-click! how do i tackle the pixelization?
Go to Top of Page

w2m

USA
1990 Posts

Posted - Aug 25 2013 :  09:59:15  Show Profile  Reply
Use a ietNormal StoreType. The reason why the images are pixelated is because you are stretching the images to a larger size when the display mode is mdSingle. Use the real images instead and pixelization will disappear. There is no other way to handle this problem.

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

skippix

USA
68 Posts

Posted - Aug 25 2013 :  10:10:03  Show Profile  Reply
perfect! thanks!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: