Solved

VB.Net Tile Multiple Images into One Image

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

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

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 …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 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