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
 Flattening Layer Operation images into one layer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

DMC02766

USA
27 Posts

Posted - Jun 07 2016 :  16:21:42  Show Profile  Reply
I am currently looking for a way to take what the final product looks like on the screen after doing layer operations on the layers (color dodge specifically) and save that as a new layer. I have found that photoshop basically take a snapshot of what the image on the screen looks like and snapshots it to a new layer called "merged". This link explains the problem I have and what photoshops solution is (http://www.photoshopessentials.com/photo-editing/how-to-merge-layer-blend-modes-in-photoshop/). I believe I should be able to do this with the IEBitmap.RenderToTIEBitmapex functionality but havent had much success. This is what I currently have:

imgview2r and imgview2g are imageenview with an images loaded
>>>>>

tempview and tempview2 are imageenviews with no images that will be rendered using the color dodge layer operation. tempview2 will hold the merged image.

img2layerd is an image with multiple layers that I would like to add the final product (tempview2's rendered images) to as a layer


 tempview.ieBitmap.Assign(imgview2r.IEBitmap);
 // showmessage('assigned red');
  tempview2.ieBitmap.Assign(imgview2g.IEbitmap);
 // showmessage('assigned green');
    tempview2.IEBitmap.RenderToTIEBitmapex(tempview.ieBITMAP, tempview.ieBitmap.width,0,tempview2.ieBitmap.width,tempview2.ieBitmap.height,
                                           0,0,tempview2.IEBitmap.width,tempview2.IEBitmap.width,FALSE, 255, rfnone, 
                                           ielInverseColorDodge, 1.0);

  //   showmessage('rendered');
             ilayer := img2layerd.LayersAdd;

     img2layerd.Layers[ilayer].Bitmap.Assign(tempview.bitmap);
     img2layerd.Layers[2].Name := 'MERGED BLEND';



I feel like I am overlooking something simple with this because the merged image just look like the image that is being rendered into the other- as if it is ignoring the InverseColorDodge operation during the rendertotiebitmap. Any help would be greatly appreciated.

xequte

38686 Posts

Posted - Jun 09 2016 :  01:58:27  Show Profile  Reply
Hi

This works fine for me...

// Merge images of ImageEnView1 and ImageEnView2 using "InverseColorDodge" and put onto ImageEnView3
ImageEnView3.IEBitmap.Assign( ImageEnView2.IEBitmap );
ImageEnView1.IEBitmap.RenderToTIEBitmapEx( ImageEnView3.IEBitmap,
                                           0, 0, ImageEnView2.IEBitmap.Width, ImageEnView2.IEBitmap.Height,
                                           0, 0, ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height,
                                           FALSE, 255, rfNone,
                                           ielInverseColorDodge );
ImageEnView3.Update;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

DMC02766

USA
27 Posts

Posted - Jun 09 2016 :  16:02:01  Show Profile  Reply
Thanks Nigel! It works perfectly now using your example. I had one little glitch but realized I had this line which called for the width twice in place of the height making it out of sorts:


tempview2.IEBitmap.width,tempview2.IEBitmap.width,FALSE, 255, rfnone,      ielInverseColorDodge, 1.0);


Thanks again- this functionality will be very handy.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: