-
June 13th, 2014, 06:49 AM
#1
Calling sub/function during bitmap creation.
Hey, I think this is an easy one.
I am making a large bitmap from several data sources with some logic and think it would be nice to keep the different streams in sub programs but I don't know how to pass the parameters (i think that's the term) to the sub and then back.
Any help appreciated.
Here is a simple example of what I need. There seems to be an option of writing the bitmaps to files and then joining them but that may not be an optimal choice.
Dim b As New Bitmap(400, 400)
Dim g As Graphics = Graphics.FromImage(b)
g.DrawEllipse(Pens.Red, New RectangleF(33.33, 0, b.Width, b.Height))
g.DrawEllipse(Pens.Red, New RectangleF(223.33, 0, b.Width, 222))
g.DrawLine(Pens.Red, 0, 0, 44, 44)
'call sub or function to draw something else
PictureBox1.Image = b
'b.Save("c:\temp.bmp")
g.Dispose()
-
June 13th, 2014, 07:17 AM
#2
Re: Calling sub/function during bitmap creation.
Sorry, that was too simple.
Call button3again(g)
------------------------------------------------------
Private Sub button3again(ByVal g)
g.DrawLine(Pens.Red, 0, 0, 44, 200)
End Sub
-
June 16th, 2014, 12:35 PM
#3
Re: Calling sub/function during bitmap creation.
Check out the differences between ByVal and ByRef. Would ByRef be more appropriate in your case?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|