Solved

Help with bitBlt

Posted on 1998-06-23
8
244 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

717 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