以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  图片上作图  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=72916)

--  作者:machle
--  发布时间:2015/8/8 17:11:00
--  图片上作图
想实现这样一种功能,在窗口中放一张图片,再在图片上面某些坐标点处画点,然后把这些点连线,可以覆盖那张图片上的某些内容。

请问该怎么实现,谢谢!

--  作者:有点蓝
--  发布时间:2015/8/8 17:22:00
--  
参考GDI画图
http://www.foxtable.com/help/index.html?n=1482.htm

[此贴子已经被作者于2015/8/8 17:22:24编辑过]

--  作者:machle
--  发布时间:2015/8/8 18:38:00
--  回复:(有点蓝)参考GDI画图http://www.foxtable.com...
 非常感谢,我试试!
--  作者:machle
--  发布时间:2015/8/8 18:43:00
--  回复:(machle)回复:(有点蓝)参考GDI画图http://...
 导入的图片怎么缩放啊?格式怎么弄?像素太大,和paint比例不对。

Dim p As WinForm.Painter = e.Form.Controls("Painter1")
Dim
g As Graphics = p.Graphics
g.DrawImage(getImage("logo.jpg"),10,10)
p.Repaint()



--  作者:大红袍
--  发布时间:2015/8/9 11:12:00
--  
Dim p As WinForm.Painter = e.Form.Controls("Painter1")
Dim g As Graphics = p.Graphics
Dim img = getImage("d:\\test.jpg")
If img.width > img.height Then
    Dim w As Integer = p.width
    Dim h As Integer = (p.width / img.width) * img.height
    g.DrawImage(img,0,0,w,h)
Else
    Dim w As Integer = (p.height / img.height) * img.width
    Dim h As Integer = p.height
    g.DrawImage(img,0,0,w,h)
End If
p.Repaint