Solved

Joining Images.....

Posted on 2004-08-13
2
216 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
[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
2 Comments
 
LVL 86

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 Month6 days, 2 hours left to enroll

627 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