Solved

Help with bitBlt

Posted on 1998-06-23
8
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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
 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 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