Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Game Programming > Blt image size and blt part of image


Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2004, 02:50 PM
jmanomega's Avatar
jmanomega jmanomega is offline
Centurion
 
Join Date: Jul 2004
Location: Missouri, USA
Posts: 170
Question Blt image size and blt part of image


I was wondering if it takes more time to blt:
1 800x600 Bitmap
or
48 100x100 Bitmaps
or
192 50x50 Bitmaps
(all end up as 800x600)

And, if it is faster to blt 1 800x600 Bitmap, then is there a way to only blt a part of a larger bitmap(say a 800x600 section out of a 2000x2000)?
Reply With Quote
  #2  
Old 10-27-2004, 03:33 PM
noi_max's Avatar
noi_max noi_max is offline
Still asleep...

Retired Leader
* Expert *
 
Join Date: Nov 2003
Location: IronForge
Posts: 2,694
Default

This is a good question... and I suppose it would depend on what you're doing.

I think blitting one large image would take less time than blitting many smaller images, if it were to happen in each iteration of say a game loop.

I have a scrolling map demo, where the final map surface is huge, but only a visible portion is blitted like you said, and only after the smaller tiles are already assembled.

http://www.xtremevbtalk.com/showthread.php?t=184577

Post # 6
__________________
~ Jason

Use [vb][/vb] tags when posting code :) || Search the forum and MSDN|| Check out the Posting Guidelines
Reply With Quote
  #3  
Old 10-27-2004, 03:50 PM
anon anon is offline
Senior Contributor

Retired Leader
* Expert *
 
Join Date: Dec 2003
Location: Offline
Posts: 861
Default Blt-ing speed

Blt-ing many small blts almost always takes more time then one large one..

However, there are a couple ways that you can "even out" the differences:

1.) You can assembly (Bitblt together) all the small images/sprites/tiles together in a memoryDC backbuffer first, before "flipping" the backbuffer onto the screen (in a form or picturebox control) using Bitblt.
2.) You can use the LockWindowUpdate API to keep the form or picturebox control from updating (re-painting itself) during a series of Bitblt calls.

As regards to sectioning off a part of the picture, the Bitblt API allows for this using the correct dimensional parameters (X,Y values)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->