Solved

VB.Net Tile Multiple Images into One Image

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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 …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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