Solved

VB.Net Tile Multiple Images into One Image

Posted on 2004-08-08
1
1,558 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Multiple file Upload asp.net 2 39
How to open a link from vb.net app 3 22
Closing all open child forms. 4 38
Iterate a dictionnary to change values 4 53
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now