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:rolleyes::rolleyes:
Printable View
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:rolleyes::rolleyes:
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
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)
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
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
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?
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