473,395 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Mergin images

164 100+
Hi to all


Please give me code samples to merge two or more images into a single image using VB. Please send me immediately...

Thanx
Feb 9 '07 #1
5 3358
iburyak
1,017 Expert 512MB
What do you mean merge images? Like picture of a dog to merge with a cat?
How program should decide what part of the image goes where?

Open paint and try to do it manually. It is tedious job even when you are looking at it.


Use Photoshop instead of VB.
Feb 9 '07 #2
Killer42
8,435 Expert 8TB
Please give me code samples to merge two or more images into a single image using VB. Please send me immediately...
I think you need to be more specific about what you mean by "merge" in this context. Are you talking about morphing, or what?
Feb 9 '07 #3
arunbalait
164 100+
No not at all morphing....

Merging in the sense combinig two or more pictures into a single one...



If we are having more than one image files then after selecting those multiple images merging operation has to be done and the selected images would be saved as a single image...


For eg, We having images like several animals as different pictures If we selected those pictures and merge then those pictures must be merged as a single one like the output having group of animals...


Got it?

Thanx...


Is it possible?
Feb 9 '07 #4
No not at all morphing....

Merging in the sense combinig two or more pictures into a single one...



If we are having more than one image files then after selecting those multiple images merging operation has to be done and the selected images would be saved as a single image...


For eg, We having images like several animals as different pictures If we selected those pictures and merge then those pictures must be merged as a single one like the output having group of animals...


Got it?

Thanx...


Is it possible?

Here is the code you should check out.
I deserve no credit for this code, however it functions with the result I believe you are attempting to achieve.

In Control properties, browse for Picture 1 and assign it to picSource.
Now, browse for picture 2 and assign it to picDestination.

With These Controls In the frmMain Module.

barAmount (Slider)
Label1,Label2,Label3,Label4
lblInfo
picDestination
picSource

Expand|Select|Wrap|Line Numbers
  1. '*****************************CODE IN FORM MODULE
  2.  
  3.  
  4. ' ********************************************
  5. ' ** Purpose: Alpha Blending Pictures
  6. ' ** Website : www.svenni.com
  7. ' ** Programmer : Sveinn R. Sigurdsson
  8. ' ** e-mail : depill2000@hotmail.com
  9. ' ********************************************
  10. Option Explicit
  11.  
  12. ' API DECLARATION [ ALPHA BLEND FUNCTION ]
  13. Private Declare Function AlphaBlend Lib "msimg32" ( _
  14. ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, _
  15. ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, _
  16. ByVal xSrc As Long, ByVal ySrc As Long, ByVal widthSrc As Long, _
  17. ByVal heightSrc As Long, ByVal blendFunct As Long) As Boolean
  18.  
  19. ' API DECLARATIONS [ COPY MEMORY FUNCTION ]
  20. Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
  21. Destination As Any, Source As Any, ByVal Length As Long)
  22.  
  23. ' TYPE STRUCTURES
  24. Private Type typeBlendProperties
  25.     tBlendOp As Byte
  26.     tBlendOptions As Byte
  27.     tBlendAmount As Byte
  28.     tAlphaType As Byte
  29. End Type
  30.  
  31. Private Sub barAmount_Scroll()
  32.     ' Procedure Scope Declarations
  33.     Dim tProperties As typeBlendProperties
  34.     Dim lngBlend As Long
  35.         ' Clear the destination picture
  36.     picDestination.Cls
  37.     tProperties.tBlendAmount = 255 - barAmount
  38.     ' Call the 'CopyMemory' with the specified parameters
  39.     CopyMemory lngBlend, tProperties, 4
  40.     ' Blend the pictures together and show them at the specified
  41.     ' location in the specified picture box.
  42.     AlphaBlend picDestination.hDC, 0, 0, picSource.ScaleWidth, picSource.ScaleHeight, _
  43.     picSource.hDC, 0, 0, picSource.ScaleWidth, picSource.ScaleHeight, lngBlend
  44.     ' Refresh the picture box with the new image
  45.     picDestination.Refresh
  46. End Sub
  47.  
Please resond if this is your intended goal or if an alternate goal is expected.
Good luck.
Feb 11 '07 #5
RE: My Last Reply : ALPHABLENDING

It is obvious that some controls are not needed, however I did not wish to hack apart another developers code for the example. The labels are not required and with a common dialog and proper code you can easily change the application to the user to select images during runtime. The AlphaBlending API was apparently shipped with Win98 and allows the user to set transparency level of a picture.
Good Luck, Again.
Feb 11 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Wayne | last post by:
I have a script that uses filesystemobject that reads files from a given path, in my case images. It is running on a server that is 2000 adv svr w/ all current patches. The script prior to some...
11
by: Penelope Baker | last post by:
Greetings: I cannot seem to get IE 6.0 to pre-cache my rollover images. Every time the user rolls over a link, it rereads it from the server, even though it is well into the cache by that time....
2
by: Julie | last post by:
Hi, I'm trying to change images on a website without reloading the whole page and use the following code to preload the images: var preloadFlag = false; function preloadImages() { if...
3
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a...
4
by: Bernie Raffe | last post by:
When I change the 'cookieless' flag in the WebConfig file to true, everything works fine on my local PC, but the images fail to appear when using the remote server. I specify my images...
2
by: Alex | last post by:
I have a web application hosted on the server's F:\www directory. I have images stored on the file system at E:\Images. I have the website shared thru IIS pointing to the F:\www directory. 1.)...
4
toxicpaint
by: toxicpaint | last post by:
Hi, can anyone give me a hand. I'm currently displaying 4 random images at the top of a page. I did this using an array of 35 pictures and then writing them to page. The problem I have is that in...
5
by: remon87 | last post by:
I need some help. I have javasript that creates the submenu but it works if I have a text with css. I need it to do the same with a roll over images. so when I click on the image the submenu...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.