首页 新闻 搜索 专区 学院

imageenview画直线

0
悬赏园豆:100 [已解决问题] 解决于 2019-08-05 10:12

 我用imageenview控件打开图片,然后我想在这个图片上画直线,但是我画出来的直线是虚线。我想要的是直线。请问怎么解决,我的代码是:

procedure tform1.imgenviewmousemove(sender:Tobject;shift:Tshiftstate;x,y:integer);
begin
imgenview.iebitmap.canvas.pen.style := pssolid;
imgenview.iebitmap.canvas.pen.mode:= pmnotxor;
imgenview.iebitmap.canvas.pen.color:= clred;
imgenview.iebitmap.canvas.pen.width :=1;
imgenview.iebitmap.canvas.pen.moveto(imgenview.xscr2bmp(fstartx),imgenview.xscr2bmp(fstarty));
imgenview.iebitmap.canvas.pen.lineto(imgenview.xscr2bmp(flastx),imgenview.xscr2bmp(flasty));
Flastx := x;
Flasty :=y;
imgenview.iebitmap.canvas.pen.moveto(imgenview.xscr2bmp(fstartx),imgenview.xscr2bmp(fstarty));
imgenview.iebitmap.canvas.pen.lineto(imgenview.xscr2bmp(flastx),imgenview.xscr2bmp(flasty));
imgenview.update;
end;

这个就是那个控件名称
imgenview:TImgeenview;

liguang178的主页 liguang178 | 初学一级 | 园豆:110
提问于:2012-03-01 20:17
< >
分享
最佳答案
0

你的意思是不是实线吧,imgenview.iebitmap.canvas.pen.mode:= pmnotxor; 这句话改一下,就ok 了。你那个异或了,当然看起来一段一段的了。

 

各种模式如下

pmBlackAlways black
pmWhiteAlways white
pmNopUnchanged
pmNotInverse of canvas background color
pmCopyPen color specified in Color property
pmNotCopyInverse of pen color
pmMergePenNotCombination of pen color and inverse of canvas background
pmMaskPenNotCombination of colors common to both pen and inverse of canvas background.
pmMergeNotPenCombination of canvas background color and inverse of pen color
pmMaskNotPenCombination of colors common to both canvas background and inverse of pen

pmMergeCombination of pen color and canvas background color
pmNotMergeInverse of pmMerge: combination of pen color and canvas background color
pmMaskCombination of colors common to both pen and canvas background
pmNotMaskInverse of pmMask: combination of colors common to both pen and canvas background
pmXorCombination of colors in either pen or canvas background, but not both
pmNotXorInverse of pmXor: combination of colors in either pen or canvas background, but not both


收获园豆:100
ChatinCode | 老鸟四级 |园豆:2272 | 2012-03-05 10:19

不好意思啊。。。那会解决了问题,后来一直没上这个博客了。。。谢谢你啊。。

liguang178 | 园豆:110 (初学一级) | 2019-08-05 10:12
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册