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
 How to copy 32Bit bitmap to clipboard?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

uko

Germany
31 Posts

Posted - Feb 09 2015 :  04:03:13  Show Profile  Reply
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.

xequte

38613 Posts

Posted - Feb 09 2015 :  21:07:17  Show Profile  Reply
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
Go to Top of Page

uko

Germany
31 Posts

Posted - Feb 10 2015 :  07:30:24  Show Profile  Reply
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
Go to Top of Page

xequte

38613 Posts

Posted - Feb 16 2015 :  18:47:21  Show Profile  Reply
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
Go to Top of Page

uko

Germany
31 Posts

Posted - Feb 17 2015 :  02:40:56  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: