Insert Border around a picture

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wonder if there is an easy way to plase a border around a picture.

I have already tryed with the trasparent function but the border gets upon
the picture so it hides some of it.

I have created borders with white space in the middle and with the
bmp_Frame.MakeTransparent(Color.White)

and
Dim pointToDraw As New RectangleF(0, 0, PictureBox1.Width, PictureBox1.Height)

gr.DrawImage(bmp_Frame, pointToDraw)

I create a new picture having on top the border.

What I want is to place it around.

regards

Aris Lazaridis
 
So what is happening when you create the new bitmap?

Seems you would create a new bitmap, bigger than the original, according to
border width, offset the top left corner accordingly, drawimage from
original to new one and then save/display it.

What's happening?

shane
 
Aris said:
I wonder if there is an easy way to plase a border around a picture.

\\\
Dim b As Image = Bitmap.FromFile("C:\WINDOWS\Angler.bmp")
Me.PictureBox1.Image = CreateFramedImage(b, Color.Yellow, 2)
b.Dispose()
..
..
..
Private Function CreateFramedImage( _
ByVal Source As Image, _
ByVal BorderColor As Color, _
ByVal BorderThickness As Integer _
) As Image
Dim b As New Bitmap( _
Source.Width + BorderThickness * 2, _
Source.Height + BorderThickness * 2 _
)
Dim g As Graphics = Graphics.FromImage(b)
g.Clear(BorderColor)
g.DrawImage(Source, BorderThickness, BorderThickness)
g.Dispose()
Return b
End Function
///
 
Thanks for your answer but I know this much.
What I need is to figure out the dimentions of the inner white space of each
border ... if it is possible ?

You see I want to have predifined images as borders with drawings to put
around the pictures.

Thanks in advance
and thanks again for your tip.
 
Thanks for your time but..

I dont know exactly what will be the border thikness.
I want to calculate somehow the inner white space or some other color to
create inside of it the new image (picture)

Regards
Aris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top