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
 Help ! Thumbnails ImageEnMView on ImageEnView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Boban

Yugoslavia
41 Posts

Posted - May 12 2012 :  01:35:17  Show Profile  Reply
Please help

How to paste all the thumbnails by pressing the button on the ImageEnMView on ImageEnView

Hello everyone on the forum.

fab

1310 Posts

Posted - May 12 2012 :  03:06:51  Show Profile  Reply
Do you want copy a frame of TImageEnMView to TImageEnView?
Go to Top of Page

fab

1310 Posts

Posted - May 12 2012 :  13:01:48  Show Profile  Reply
Perhaps I still do not understand your question.

However, to copy a frame from TImageEnMView to TImageEnView, execute:
ImageEnMView1.CopyToIEBitmap(frameIndex, ImageEnView1.IEBitmap);
ImageEnVIew1.Update();
...now you could write to file using ImageEnView1.IO.SaveToFile('out.jpg');

Instead to extract a frame directly to jpeg:

ImageEnMView1.GetImageToFile(frameIndex, 'output.jpg');

Hope this helps.
Go to Top of Page

fab

1310 Posts

Posted - May 13 2012 :  01:13:23  Show Profile  Reply
Hi Boban,
TImageEnView can contain only one image at the time. How should it contains all the frames of TImageEnMView?
Maybe:
1) create a grid of images
2) create a sequence of image (an animation?)
3)...?
Go to Top of Page

Boban

Yugoslavia
41 Posts

Posted - May 13 2012 :  01:51:56  Show Profile  Reply
Hi Fabrizio

1) create a grid of images
Go to Top of Page

fab

1310 Posts

Posted - May 13 2012 :  02:58:44  Show Profile  Reply
Simplest solution, use TImageEnMView.PaintTo:
ImageEnView1.IEBitmap.Allocate(ImageEnMView1.Width, ImageEnView1.Height);
  ImageEnMView1.PaintTo( ImageEnView1.Bitmap );
  ImageEnView1.Update();

Advanced solution (I prefer this), draw each image:
var
  i: integer;
  row, col: integer;
  imageWidth, imageHeight: integer;
  thumbWidth, thumbHeight: integer;
  rowCount, colCount: integer;
  bmp: TIEBitmap;
begin
   // you may want to change these
  imageWidth  := 1000;
  imageHeight := 1000;
  thumbWidth  := ImageEnMView1.ThumbWidth;
  thumbHeight := ImageEnMView1.ThumbHeight;

  colCount := imageWidth div thumbWidth;
  rowCount := ImageHeight div thumbHeight;
  ImageEnView1.IEBitmap.Allocate(imageWidth, imageHeight);

  row := 0;
  col := 0;

  for i:=0 to ImageEnMView1.ImageCount-1 do
  begin
    bmp := ImageEnMView1.GetTIEBitmap(i);
    bmp.RenderToTIEBitmapEx(ImageEnView1.IEBitmap,
                            col * thumbWidth, row * thumbHeight,
                            thumbWidth, thumbHeight,
                            0, 0, bmp.Width, bmp.Height,
                            255, rfFastLinear, ielNormal);
    ImageEnMView1.ReleaseBitmap(i);
    inc(col);
    if col = colCount then
    begin
      col := 0;
      inc(row);
      if row = rowCount then
        break;
    end;
  end;
  ImageEnView1.Update();
end;


You may want to add code to display text, to add space between images and to respect aspect ratio.
Go to Top of Page

fab

1310 Posts

Posted - May 14 2012 :  01:01:57  Show Profile  Reply
You have to adapt second example to your necessities (distance between frames, background color, and size of background).

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: