Solved

VB.Net Tile Multiple Images into One Image

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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