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
 How to copy 32Bit bitmap to clipboard?

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
uko Posted - Feb 09 2015 : 04:03:13
Hi,

how can copy a selection from ImageENView to clipboard? I tried it with .Proc.SelCopyToClip but this fails when pasting the image back to Paint or Gimp: there is a pasted image created with correct size but no content.
I found that the problem is, that the pixel format is ie32RBG. Loading an image with ie24RGB works fine. And it also seems to be related to selection: if no selection was done, then copy/paste works fine but as soon there is a selection done, pasted image is empty.

So what to do to copy a selection?

I'm using ImageEn 5.2.0 with Delphi XE.
4   L A T E S T    R E P L I E S    (Newest First)
uko Posted - Feb 17 2015 : 02:40:56
Hi Nigel,

Thanks for improving support for ie32RGB! Was your suggestion to use
ImageEnView1.IEBitmap.CopyFromTBitmap(bmp);
a general note? Also when doing so, it will not solve the problem itself as the resulting IEBitmap still has pixel format ieRGB32.

best regards,
Ulrich
xequte Posted - Feb 16 2015 : 18:47:21
Hi

We've now added improved ie32RGB support in the relevant routines, but a better way is to use:

ImageEnView1.IEBitmap.CopyFromTBitmap(bmp);

or CopyFromMemory.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
uko Posted - Feb 10 2015 : 07:30:24
Hi,

you can use this code to reproduce: place a standard ImageEnView1 on form and execute this code:


  bmp := TBitmap.Create;
  try
    bmp.SetSize(200, 200);
    bmp.PixelFormat := pf32bit;
    bmp.HandleType := bmDIB;
    bmp.Canvas.Brush.Color := clLime;
    bmp.Canvas.FillRect(rect(0,0,200,200));

    ImageEnView1.LegacyBitmap := true;
    ImageEnView1.Bitmap.Assign(bmp);
    ImageEnView1.Update;

    ImageEnView1.SelectionBase := iesbBitmap;
    ImageEnView1.Select (10,10, 190, 190);
    ImageEnView1.Proc.SelCopyToClip();
  finally
    bmp.Free;
  end;

then paste result to Paint or Gimp and see the colors.

On my real world application I assign an TBitmap32 instance (containing bitmaps with alpha) from Graphics32 to an imageENView and try to copy a selection from it to clipboard (Graphics32 was used here on legacy code so I can't replace it)

best regards,
Ulrich
xequte Posted - Feb 09 2015 : 21:07:17
Hi

I cannot reproduce this. Please forward and example image and the code you use to load it. Also, what is your setting for ImageEnView.LegacyBitmap.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com