Solved

Joining Images.....

Posted on 2004-08-13
2
202 Views
Last Modified: 2010-05-02
I have a few Images with names as Pic11, Pic12, Pic13, Pic21, Pic22, Pic23, Pic 31, Pic32, Pic33
They are all present in one folder let's say "C:\Imran"
They are basically parts of one big image......

They should be joined like this......

Pic11       Pic12         Pic13

Pic21       Pic22         Pic23

Pic31       Pic32         Pic33

to make a big picture and there should be no gap (white pixel array) between these pictures......

Currently I am using Phototshop to join these Pictures but I am sure it can be done in VB very easily....

Any solution with PictureBox/Image Box or anything else that returns me a Picture that is made up of joining these small parts is acceptable to me......
and note that all of these are BMP and the resultant Picture should also be a BMP.......

Imran Arshad
0
Comment
Question by:imarshad
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 11792701
I  have modified on of my previous solutions to suit your needs:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20912572.html

The following project needs a PictureBox and a CommandButton:

Option Explicit

Private Const picCols = 3
Private Const picRows = 3
Private Const picWidth = 20  ' <-------- Change this to the width of your images
Private Const picHeight = 25 ' <-------- Change this to the height of your images

Private Sub Form_Load()
    Me.ScaleMode = vbPixels
    Picture1.Appearance = 0 ' Flat
    Picture1.BorderStyle = 0 ' None
    Picture1.ScaleMode = vbPixels
    Picture1.Width = picCols * picWidth
    Picture1.Height = picRows * picHeight
    Picture1.AutoRedraw = True
End Sub

Private Sub Command1_Click()
    Dim x As Integer
    Dim y As Integer
    Dim c As Integer
    Dim f As String
    Dim p As String
         
     
    c = 1
    p = "C:\Imran\"
    For y = 1 To picRows
        For x = 1 To picCols
            f = "Pic" & ((y * 10) + x) & ".bmp"
            If Dir(p & f) <> "" Then
                Picture1.PaintPicture LoadPicture(p & f), (x - 1) * picWidth + 1, (y - 1) * picHeight + 1
            Else
                MsgBox "File " & p & f & " not found"
            End If
            c = c + 1
        Next x
    Next y
   
    Picture1.Picture = Picture1.Image
    SavePicture Picture1.Image, p & "Joined.bmp"
End Sub
0
 
LVL 13

Author Comment

by:imarshad
ID: 11796933
Thanks Mike,
                      It works great.......Saves quite a bit of time for me........
Imran Arshad
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now