Solved

Help with bitBlt

Posted on 1998-06-23
8
231 Views
Last Modified: 2010-05-03
I just started working with VB5.0 and I don't have any idea how to use BitBLT. I would really like a WORKING example for VB5.0    Then just a simple explanation of what is going on and all. Please email any examples to Xer_Soft@hotmail.com                 Thanks a lot.
0
Comment
Question by:xer_soft
8 Comments
 
LVL 9

Expert Comment

by:Dalin
ID: 1464094
xer_Soft,
Try the following.
Regards
Dalin

'Declararion

Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Const SRCCOPY = &HCC0020


Calls:

BitBlt picTo.hDC, 0, 0, picFrom.ScaleWidth, picFrom.ScaleHeight, picFrom.hDC, 0, 0, SRCCOPY
0
 
LVL 1

Author Comment

by:xer_soft
ID: 1464095
Dalin  This is great!!! I got this to work... I think. But now how do I make parts Transparant.
I am sorry for not saying this in the first question. I have added 20 points for my mistake. Thanks
a lot.
0
 
LVL 1

Author Comment

by:xer_soft
ID: 1464096
This is great! I thing I got this to work. But how do I make parts of the .bmp transparant. I am
sorry I have failed to say this in my first question. For my mistake I have added 20 points.
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1464097
xer_Soft
There is a example:

Creating a Transparent Bitmap
http://home.sprynet.com/sprynet/rasanen/vbnet/default.htm

Any questions let me know
Regards
Dalin
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:xer_soft
ID: 1464098
   Thanks for all the help so far... But I still have more Questions. I have got the code you gave me to work but it is not exactly what I wanted. I did not know there were so many uses for the bitBLT function. So I will tell you what I want to do and hopefully you will be able to help me. I want to make a game grid out of picture boxes. On this grid there will be pics of the game bord in bmp format. Then I want to put the player on the map on one of the picture boxes. I already see I will have to actuley use two grids: one for the map and one for where ever the player is going to be. At least I think this is how it should be done. The map will always be there. Just the plays pic will move around(change boxes). But I want to pic to look like it is on top of the map. I hope this helps you see what I want. And I hope it does not scare you off. This is my first time asking a question and I was not thinking when I asked it.   Thanks again
0
 
LVL 1

Expert Comment

by:cip
ID: 1464099
Why not use the imageList control? It can manage an array of regular pictures, and it manages transparency.

0
 

Accepted Solution

by:
MikeReilly earned 120 total points
ID: 1464100
Check the following URL for a complete set of tutorials on BitBlt and a number of other sprite related routines (in fact it teaches you how you can make your own sprite engine):

http://www.geocities.com/SiliconValley/Bay/9520/tutor.html

Just make sure you use the 32 bit function declares (they are included in a lot of the source, but are commented out).  The guy that runs the site has done a great job of setting this up.  There are a few errors here and there, but it's FREE.
0
 
LVL 1

Author Comment

by:xer_soft
ID: 1464101
If there was a better grade I would give it to you. This is what I wanted. Thank you very much!!!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now