?
Solved

copy bitmap over second bitmap

Posted on 2003-03-29
5
Medium Priority
?
270 Views
Last Modified: 2010-05-01
I have a problem. I want to copy a bitmap over second bitmap and then save that bitmap as third bitmap.If anybody knows this solution pleasehelp.

0
Comment
Question by:malik_mumtaz
[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
5 Comments
 
LVL 1

Accepted Solution

by:
foxyshadis earned 336 total points
ID: 8231819
Are you looking for something like this?

pctGraph3.Cls
pctGraph3.PaintPicture pctGraph1.Image, startX1, startY1
pctGraph3.PaintPicture pctGraph2.Image, startX2, startY2

That clears the third, then layers the first and second onto it. If you need to save it to disk, you then use:

SavePicture pctGraph3.Picture, Path & Name & ".bmp"
0
 
LVL 2

Assisted Solution

by:JoaTex
JoaTex earned 332 total points
ID: 8232825
Hi

Try This Little Program:

Put in a form
3 CommonButtons
3 Picture Box

Name command1 = cmdBlend
Name Command2 = cmdReset
Name Command3 = cmdSave
Name Picture1 = Picsrc1
Name Picture2 = Picsrc2
Name Picture3 = PicDest
Set All Picture to:
ScaleMode = 3-Pixel
Set PicDest to:
AutoRedraw = True

Now put 1 Picture on  on Picsrc1 and other on Picsrc2 (can be any kind of picture or Graphic)

Run the Code,Click Blend and Save it.

Code:

Option Explicit

    Private Function Blend( _
          ByVal Color1 As Long, _
          ByVal Color2 As Long) As Long

          Dim r As Long, g As Long, b As Long

          b = ((((Color2 \ &H10000) And &HFF) * 50) + _
               (((Color1 \ &H10000) And &HFF) * 50)) \ 100

          g = ((((Color2 \ &H100) And &HFF) * 50) + _
               (((Color1 \ &H100) And &HFF) * 50)) \ 100

          r = (((Color2 And &HFF) * 50) + _
               ((Color1 And &HFF) * 50)) \ 100

          Blend = RGB(r, g, b)
     End Function

     Private Sub cmdBlend_Click()
          Dim x As Long
          Dim y As Long

          For y = 0 To Picsrc1.ScaleHeight
               For x = 0 To Picsrc1.ScaleWidth
                    PicDest.PSet (x, y), Blend(Picsrc1.Point(x, y), Picsrc2.Point(x, y))
               Next
          Next
     End Sub

Private Sub CmdSave_Click()
   SavePicture PicDest.Image, App.Path & "\Teste.bmp"
End Sub

Private Sub Command1_Click()
          Dim x As Long
          Dim y As Long

          For y = 0 To Picsrc1.ScaleHeight
               For x = 0 To Picsrc1.ScaleWidth
                    PicDest.PSet (x, y), Point(x, y)
               Next
          Next
End Sub

Hope it suites You
Jo
0
 
LVL 53

Assisted Solution

by:Ryan Chong
Ryan Chong earned 332 total points
ID: 8233194
Optionally, try explore the StretchBlt and BitBlt API.

Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (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


Declare Function StretchBlt Lib "gdi32" Alias "StretchBlt" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
0
 

Expert Comment

by:CleanupPing
ID: 8531364
Hi malik_mumtaz,
This old question (QID 20567393) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9440721
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Split between foxyshadis and JoaTex and ryancys

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

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!

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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