如何具有位图的图形路径 [英] How to have graphics path of a bitmap

查看:97
本文介绍了如何具有位图的图形路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用getpixel或setpixel方法获得具有不规则形状的位图图像的图形路径.通过使用MakeTransparent方法,它仅隐藏了一部分,而具有该隐藏部分的区域保持不变,但我想从该区域中删除该隐藏部分,并从修改后的区域中获取新的graphicspath.


假设我创建了一个位图图像,该图像具有实际的黑色或红色背景,并且实际对象仅在忽略黑色或红色背景的情况下显示.如果我尝试使用MakeTransparent方法,则它会隐藏黑色或红色背景,但该位图的区域是相同的,包括该背景色.因此,如何获得不包含黑色或红色背景的新区域.

How can we get the graphics path of bitmap image with irregular shape using getpixel or setpixel method. By using MakeTransparent method it just hides some part and region remains same having that hidden part but I want to remove that hidden part from the region and have new graphicspath from that modified region.


Suppose I have created a bitmap image which is having actual background black or red and the actual object on it which is to be only shown ignoring the black or red background. If I try using the MakeTransparent method, ofcourse it hides the black or red background but the region of that bitmap is same including that background color. So how can I obtain the new region excluding that black or red background.

推荐答案

您将必须实现自己的边缘检测算法,以生成用于GraphicsPath.没有内置的方法可以为您跟踪"轮廓.
You''ll have to implement your own edge detection algorithm to generate the points for the GraphicsPath. There is no built-in method that will "trace" the outline for you.


我已经编辑了问题.请检查是否可以解决该问题.
I have edited my question. Kindly check it if any solution to it can be brought.


这篇关于如何具有位图的图形路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆