?
Solved

Help with bitBlt

Posted on 1998-06-23
8
Medium Priority
?
245 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

762 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