Solved

Joining Images.....

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

734 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