Solved

Joining Images.....

Posted on 2004-08-13
2
211 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

830 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