Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to save multiple jpg images and text as one jpg?

Status
Not open for further replies.

ovolen

Programmer
Aug 23, 2015
2
0
0
BA
I'm making a small Application where you can insert three pictures and that pictures will be the size of Picture Boxes.
As in the Image, Picture 1 is a jpg format and on it will be placed logo and information and it will never change(This image is format A4), other three pictures a user can added and it will be size of Picture Box.User also can add a text.
How to all these four images and text can be saved as one jpg?
 
 http://files.engineering.com/getfile.aspx?folder=42e96b75-a116-43bc-8c58-2097c6352f17&file=TEST.jpg
It strikes me, given that screenshot, you should be able to use the CopyFromScreen method of theSystem.Drawing.Graphics class
 
So, assuming I've understood your description (and your picture) correctly, something like the following:

Code:
[blue]Public Class Form1
    Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
        Dim g As Graphics = PictureBox1.CreateGraphics
        Dim s As Size = PictureBox1.Size

        Dim bmp As Bitmap = New Bitmap(PictureBox1.Width, PictureBox1.Height, g) [green]' create a compatible bitmap in memory[/green]
        Dim memoryg As Graphics = Graphics.FromImage(bmp) [green]' get a drawing surface associated with the compatible memory bitmap[/green]

        memoryg.CopyFromScreen(PointToScreen(PictureBox1.Location).X, PointToScreen(PictureBox1.Location).Y, 0, 0, s) [green]' scrape the screen[/green]
        bmp.Save("c:\example.jpg") [green]' or wherever[/green]
    End Sub
End Class[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top