Solved

VB.Net Tile Multiple Images into One Image

Posted on 2004-08-08
1
1,594 Views
Last Modified: 2012-08-13
Hi All,

I want to tile up multiple images into one image and save it as a bitmap. Is their a way that I can do this. Is there any sample code, can some one help me with this please.
0
Comment
Question by:maykut
1 Comment
 
LVL 4

Accepted Solution

by:
Daniellus83 earned 30 total points
ID: 11750915
Dear sir,

This is a very short program to tile up images.

Put this in your code and put a picturebox (picturebox1) and a button (button1) on your Form (Form1). Also put four .jpg images (1.jpg,..,4.jpg) in your \bin folder of your program.

--------------------------------------------------------------------------------------------------------------------------------------------------
    Dim pictures(4) As Image
    Dim BigBitmap As Bitmap


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim i As Integer

        For i = 1 To 4
            ' put picture into the Image array
            pictures(1) = Image.FromFile(Application.StartupPath & "\1.jpg")
            pictures(2) = Image.FromFile(Application.StartupPath & "\2.jpg")
            pictures(3) = Image.FromFile(Application.StartupPath & "\3.jpg")
            pictures(4) = Image.FromFile(Application.StartupPath & "\4.jpg")
        Next

        BigBitmap = New System.Drawing.Bitmap(400, 400)
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim graphics_edit As Graphics                  'Grafische variable definieren, is soort afdrukvoorbeeld voor de picturebox

        graphics_edit = Graphics.FromImage(BigBitmap)
        graphics_edit.Clear(Color.White)

        graphics_edit.FromImage(BigBitmap)

        graphics_edit.DrawImage(pictures(1), 0, 100, 100, 100)
        graphics_edit.DrawImage(pictures(2), 100, 0, 100, 100)
        graphics_edit.DrawImage(pictures(3), 0, 100, 100, 100)
        graphics_edit.DrawImage(pictures(4), 100, 100, 100, 100)

        picturebox1.Image = BigBitmap
        '
    End Sub
--------------------------------------------------------------------------------------------------------------------------------------------------


Warning: The images are being re-scaled.. so you my need to reconfigure the sizes (100x100 and 400x400 etc etc

Succes... Daniël
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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