Solved

Help with bitBlt

Posted on 1998-06-23
8
240 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
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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