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 draw a TIEBitmap to the canvas of TPaintbox

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
casual1001 Posted - Feb 19 2019 : 12:15:14
Hi, Anybody can help me the below question?

I assigned a bitmap to a TIEBitmap. And then process the TIEBitmap with chroma key effect. How to draw the result TIEBitmap to the canvas of TPaintBox with the chroma key effect?

Thanks
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Feb 19 2019 : 22:22:45
Hi

1. If you want Alpha use:

https://www.imageen.com/help/TIEBitmap.DrawToCanvasWithAlpha.html

2. You'd have to show me your code. If you are using threads, ensure you are synchronizing before communicating with the UI (i.e. TPaintBox).



Nigel
Xequte Software
www.imageen.com
casual1001 Posted - Feb 19 2019 : 20:58:04
Hi Nigel,

Thanks!

I did the same as your code. But there were two issues.

1. the alphachannel of TIEBitmap didn't work.

2. System raise an "Access Violation" Error.

By the way, I put the chroma key process in a thread circulation. After process a bitmap then make the paintbox invalidate to trigger the paint event every circulation.
xequte Posted - Feb 19 2019 : 14:46:56
Hi

In the OnPaint event of the PaintBox, you just need to render the TIEBitmap to the canvas:

https://www.imageen.com/help/TIEBitmap.DrawToCanvas.html

Something like:

// trigger OnPaint event
PaintBox1.Paint();

procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
  MyChromaBitmap.DrawToCanvas( TPaintBox(Sender).Canvas, 0, 0 );
end;


Of course, that isn't scrollable, so you need to include a TScrollBox to allow scrolling (or just use a TImageEnView, of course )

Nigel
Xequte Software
www.imageen.com