Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2006, 04:08 AM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default Canvas.Draw or BitBlt?

Ahh another question

I have some components that draw to a TBitMap and when finished they call Canvas.Draw method but I am wondering if there would be any benefits by replacing it with BitBlt instead?
Reply With Quote
  #2  
Old 02-22-2006, 04:26 AM
MrBaseball34 MrBaseball34 is offline
Senior Member
 
Join Date: Jan 2001
Posts: 7,260
Default RE: Canvas.Draw or BitBlt?

Canvas.Draw does either a StretchBlt or a TransparentStretchBlt
depending upon the Transparent property.



MrBaseball34
Hook'Em Horns!

2005 College Football National Champions
2005 College Baseball National Champions
Reply With Quote
  #3  
Old 02-22-2006, 04:39 AM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default RE: Canvas.Draw or BitBlt?

Well it doesn't use a transparent property at all and I have tested BitBlt and the end result visually seems the same. I tried googling to see which is faster either BitBlt or StretchBlt api's but couldn't find much.
Reply With Quote
  #4  
Old 02-22-2006, 04:47 AM
Ryan Ryan is offline
Senior Member
 
Join Date: Feb 2001
Posts: 417
Default RE: Canvas.Draw or BitBlt?

Canvas.Draw just implements Blitting, so speed deficits are virtually negligible, though bitblt is that nanosecond faster, I'd guess a less than 0.1% performance increase.

If you want very fast graphics, use the Graph64 libraries (search Torry) which (can) use DirectX.

Warning: It's a bit involved, so try a few things first and especially study the examples BEFORE you try to implement it in your App.


"I don't care about the points, I only care about Programming..."

Ryan
Reply With Quote
  #5  
Old 02-22-2006, 04:51 AM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default RE: Canvas.Draw or BitBlt?

I am familiar with DirectX Programming though I think implementing a wrapper persay package for it would be a tad overkill.

Just thought I would get the tiny bit extra performance using BitBlt, plus i'm familiar with it andI prefer using plain Win32 API as much as i can bear.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 08:38 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.