.net - How to save graphic create by Graphics.DrawLine on PictureBox -



.net - How to save graphic create by Graphics.DrawLine on PictureBox -

its possibility save graphic create graphics.drawline on picturebox image picturebox?

its seen this:

http://pl.tinypic.com/r/140k6xf/8

my drawing function:

public sub picturebox2_mouseclick(byval sender object, byval e system.windows.forms.mouseeventargs) handles me.mousedown if picturebox1.image nil msgbox("upload image first", msgboxstyle.critical) else dim g graphics = graphics.fromimage(picturebox1.image) dim blackpen new drawing.pen(colordialog1.color, 0.5) dim currpoint point dim drawfont new font("arial", 8) dim drawbrush new solidbrush(colordialog1.color) dim drawformat new stringformat drawformat.alignment = stringalignment.center g = picturebox1.creategraphics() if previouspoint.isempty = true previouspoint = new point(e.x - 231, e.y - 52) mpx1 = e.x mpy1 = e.y else currpoint = new point(e.x - 231, e.y - 52) mpx2 = e.x mpy2 = e.y g.drawline(blackpen, previouspoint, currpoint) res = ((((mpx1 - mpx2) ^ 2) + ((mpy1 - mpy2) ^ 2)) ^ 0.5) / val(label11.text) g.drawstring(res, drawfont, drawbrush, currpoint, drawformat) previouspoint = new point(0, 0) end if blackpen.dispose() drawfont.dispose() drawbrush.dispose() drawformat.dispose() g.dispose() end if

i'm loading image in procedure, add together lines drawline , need save it. seek using various examples internet, in case dosen't work. can help me this?

you should able create new bitmap, paint graphics content on using graphics.drawimage, , save using bitmap.save.

.net vb.net visual-studio-2013

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -