Results 1 to 7 of 7

Thread: picture merge

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    261

    Red face picture merge

    hi all.
    im wanting to merge two pictures together.
    im not sure were to start,
    my pictures are 800*800 and i want to add a border to them


    thanks in advance
    programming pc: laptop. running xp pro and vb.net..
    media centre xp pc: dual core 6000,4gb memory, 1tb harddrive
    mainserver: server 2008, 8gb memory, amd e-350 dual core, 6tb harddrive and local web host
    atomvault 1: server 2008, atom 330 with 4 gb memory, 35TB hardrive space for videos and music..
    backup pc : xp, 4gb, atom 330, 10tb harddrive(web, pictures, music, databases)
    2 x video backup: atom 330, 2gb, 18tb harddrive
    everything on remote login..
    check out my builds http://AtomVaults.yolasite.com

    learning vb.net and php + mysql - got most of the basics now.

    I WISH THERE WAS MORE TIME IN THE DAY

  2. #2
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    804

    Re: picture merge

    Merge? If you just want to draw a border around a picture...

    Code:
    Private Sub Command1_Click()
     With Picture1
      .AutoSize = True
      .AutoRedraw = True
      .BorderStyle = vbBSNone
      .ScaleMode = vbPixels
      '*****change the path below to your bmp
      .Picture = LoadPicture("C:\SomeFolder\SomePic.bmp")
     End With
     DrawBorder Picture1, vbBlue, 6 'change as desired
    End Sub
    Private Sub DrawBorder(Pic As PictureBox, BorderColor As Long, BorderWidth As Long)
     Dim SW As Long, SH As Long
     With Pic
      SW = .ScaleWidth
      SH = .ScaleHeight
      .DrawWidth = BorderWidth
     End With
     Pic.Line (0, 0)-(SW - 1, SH - 1), BorderColor, B
    End Sub

  3. #3
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: picture merge

    Can you describe what you mean by merge.

    If say pixel(0,0) in one had a value of &h60FF30 and in two the value was &hFF0020 what would the merged pixel be?

    Is this a one off or would you like a general solution and do you know what colour depth the pictures are. (there is a possible very quick and dirty solution if the merging is not just a simple OR)
    Last edited by Milk; Jan 24th, 2010 at 09:50 AM.
    W o t . S i g

  4. #4
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: picture merge

    C owl

    By "merge", do you simply mean that you want
    them side-by-side (such that you end up with
    an image 800*1600 (height*width)?

    Spoo

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    261

    Re: picture merge

    hi all again
    i mean merge by.
    one picture on the botttom and one on the top. the one on top has a square hole in the middle of it so yo can see the picture below

    thanks
    programming pc: laptop. running xp pro and vb.net..
    media centre xp pc: dual core 6000,4gb memory, 1tb harddrive
    mainserver: server 2008, 8gb memory, amd e-350 dual core, 6tb harddrive and local web host
    atomvault 1: server 2008, atom 330 with 4 gb memory, 35TB hardrive space for videos and music..
    backup pc : xp, 4gb, atom 330, 10tb harddrive(web, pictures, music, databases)
    2 x video backup: atom 330, 2gb, 18tb harddrive
    everything on remote login..
    check out my builds http://AtomVaults.yolasite.com

    learning vb.net and php + mysql - got most of the basics now.

    I WISH THERE WAS MORE TIME IN THE DAY

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: picture merge

    Well bitmaps don't have holes. I assume the one with the "hole" is the border, correct? In that case you can BitBlt/PaintPicture just the "non-hole" portion to the 2nd bitmap.

    Edited: On NT-based systems, you could also use TransparentBlt if the "hole" is a color nowhere else in the border bitmap.

    Will the bitmaps always be the same size? If not,
    1. What happens when the border bitmap is larger than the other one?
    2. What happens when the other is larger than the border bitmap?

    Hmmm, is the border/frame image a transaprent GIF?
    Last edited by LaVolpe; Jan 24th, 2010 at 12:23 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: picture merge

    C_owl

    Would this accomplish what you want....

    Use 2 PictureBoxes (PBs), one for each image, where

    PB1 has the image "with the square hole"
    PB2 has the image "you can see below"

    Place PB2 "on top" of PB1 by setting the ZOrder, as in

    PB2.ZOrder = 0

    Natch, you'll need to fiddle with Height, Width, Top, and Left
    of PB2 to get it where you want it in relationship to PB1 in
    order to create the "hole"

    Spoo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width