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
 Copy/Print/Save entire grid
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

bmesser

United Kingdom
234 Posts

Posted - Nov 15 2013 :  06:00:11  Show Profile  Reply
Hi

I am using a TImageEnMView component to display 35 images in a 7x5 grid. I would like to copy, print and save the entire grid, and although I can see how to do that for selected images within the grid, I've looked in the help and can't see anyway of saving the whole grid in its entirety. Can anyone say if its possible, or do I have to save, print and copy the panel or form that the component sits in.

Bruce.

w2m

USA
1990 Posts

Posted - Nov 15 2013 :  07:31:04  Show Profile  Reply
Please clarify... What do you want to copy selected images to?
Do you wish to print all selected images?
Do you wish to save the contents of the grid for reloading, or or save each selected image in the grid?

or do you want to obtain an image of the grid and its visible images as it appears on the screen?

William Miller
Go to Top of Page

bmesser

United Kingdom
234 Posts

Posted - Nov 15 2013 :  07:36:10  Show Profile  Reply
Bill

The last one! I want to copy/paste/print the entire grid as it looks on the screen.

Bruce.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Nov 15 2013 :  09:07:32  Show Profile  Reply
This code gets a bitmap of the ImageEnMView control and the visible frames. It does not show the scrollbar however.

function ControlToBitmap(AControl: TWinControl): TBitmap;
begin
  Result := TBitmap.Create;
  with Result do begin
    Height := AControl.Height;
    Width  := AControl.Width;
    Canvas.Handle := CreateDC(nil, nil, nil, nil);
    Canvas.Lock;
    AControl.PaintTo(Canvas.Handle, 0, 0);
    Canvas.Unlock;
    DeleteDC(Canvas.Handle);
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ImageEnView1.Bitmap.Assign(ControlToBitmap(ImageEnMView1));
  ImageEnView1.Bitmap.PixelFormat := pf24bit;
  ImageEnView1.Update;
end;



Then to print or save the image just use the image:
procedure TForm1.PrintCaptured1Click(Sender: TObject);
begin
  ImageEnView1.IO.DoPrintPreviewDialog(iedtDialog, 'Captured thumbanils', False, 'MyThumbnails');
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

bmesser

United Kingdom
234 Posts

Posted - Nov 15 2013 :  09:36:41  Show Profile  Reply
Thanks Bill, that works a treat!

I suppose not many people have asked for that kind of functionality so its never been built into the component as a method.
Go to Top of Page

xequte

39109 Posts

Posted - Nov 16 2013 :  16:26:43  Show Profile  Reply
Hi

Bill's is a good method for copying/printing the content of a control.

For other users reading this thread: If you want to save all/selected thumbnails in a TImageEnMView then you can use:

http://www.imageen.com/help/TImageEnMIO.PrintImagesToFile.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: