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
 Paste a bitmap image into a selected rectangle
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

eljainc

23 Posts

Posted - Aug 07 2014 :  08:10:44  Show Profile  Reply
Hello,

Can someone tell me how I can insert a bitmap image into a selected region on an ieViewer.Image component. Or is there a way to do a copy and paste from an image to this selected region?

Thanks
Mike

w2m

USA
1990 Posts

Posted - Aug 07 2014 :  12:15:06  Show Profile  Reply
Use... TImageEnProc.SelPasteFromClipStretch

Declaration

procedure SelPasteFromClipStretch(MergeAlpha: Boolean=true);


Description

This method pastes the clipboard image to the selected region, stretching the image to fit the selection.
All uncompressed DBI formats are handled (1, 4, 8, 15, 16, 24 and 32 bits).
If clipboard image is 4, 8, 15, 16, 24 or 32 bits, it is converted to 24 bit, otherwise (1 bit) it remains 1 bit.

If MergeAlpha is valid only trasfering image in internal format.
It merges the pasting bitmap alphachannel with the background bitmap.

procedure TForm1.Paste1Click(Sender: TObject);
{ Paste1Click. }
begin
  if ImageEnView1.Proc.IsClipboardAvailable then
  begin
    ImageEnView1.Proc.SaveUndoCaptioned
      ('Paste ' + IntToStr(ImageEnView1.Proc.UndoCount));
    ImageEnView1.Proc.ClearAllRedo;
    if ImageEnView1.Selected then
    begin
      ImageEnView1.Proc.SelPasteFromClip(True);
      ImageEnView1.Update;
    end
    else
      ImageEnView1.Proc.PasteFromClipboard;
    ImageEnView1.Update;
  end
  else
  begin
    ShowMessage('There are no image in the clipboard.');
  end;
end;


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

eljainc

23 Posts

Posted - Aug 07 2014 :  12:34:07  Show Profile  Reply
Bill, thanks for the message.
How do I load a temporary image INTO the clipboard?

is there something like ImageEnView1.Proc.CopyToClipboard ?



A small little correction to the MessageBox.Show() at the end of the code snippet:


begin
ShowMessage('There are no image in the clipboard.');
end;

There is no image in the clipboard.




Mike

Go to Top of Page

w2m

USA
1990 Posts

Posted - Aug 07 2014 :  12:39:01  Show Profile  Reply
For goodness sakes... take the time to look at the help file. It makes no sense for me to duplicate the help file here.... but the answer is: Proc.SelCopyToClip or Proc.CopyToClipboard.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: