Solved

Creating one image file from two

Posted on 2002-03-08
5
146 Views
Last Modified: 2010-05-02
I have 2 scanned images (tif format) and I want to transfer them to one larger file. So if each image is 100x100 pixels then the larger file would be say 200x100.

What's the easiest method please?
0
Comment
Question by:nickwoolley
[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
5 Comments
 
LVL 1

Expert Comment

by:tandrei
ID: 6850535
Private Sub Command1_Click()
    Dim i As Integer, j As Integer
    picTarget.Width = Picture1.Width + Picture2.Width
    picTarget.Height = Picture1.Height
    For i = 0 To Picture1.Image.Height
        For j = 0 To Picture1.Image.Width
            picTarget.PSet (i, j), Picture1.Point(i, j)
        Next
        For j = 0 To Picture2.Image.Width
            picTarget.PSet (i, j + Picture1.Image.Width), Picture2.Point(i, j)
        Next
    Next

End Sub
'add 3 picture boxes on your form; Picture1 and Picture2 are autosize and load them with your images; it is slow, but should work
0
 
LVL 22

Accepted Solution

by:
rspahitz earned 75 total points
ID: 6850860
You should be able to use PaintPicture to achieve this effect.

Start by loading one image into a picturebox.  Then load the other picture into a different picturebox.  Next, enlarge one of the pictureboxes so that it has enough room to hold the image of the other picturebox.  Finally, use PaintPicture to transfer the picture to the desired location, something like this:

Private Sub Command1_Click()
  Dim Picture1Height As Double
 
  Picture1Height = Picture1.Height
  Picture1.Height = Picture1.Height + Picture2.Height
  Picture1.PaintPicture Picture2.Picture, 0, Picture1Height
End Sub

Make sure the Picture1 has autoredraw set to true or the picture will probably disappear on refresh.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6851151
every picture question has a rspahitz's comment!
:))
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6851224
I guess I just have too much fun with it!
0
 

Author Comment

by:nickwoolley
ID: 6859985
rspahitz: That works for Pictureboxes, but what about image controls?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

752 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