borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (System-wide hooks for Audio?)Next Topic (Draw a soft line) New Topic New Poll Post Reply
AndreaVB Forum : API : Path To Region Error
Poster Message
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151

icon Path To Region Error

hi there,
i want to create a REGION consisting only of the white part of a monochrome picture. The code i have used converts the white part into a PATH, and then use da PathToRegion API to convert the path into a region. As far as the formation of the path is concerned, its good, and i am able to draw it on the screen using StrokePath API. But unfortunately when the conversion of path into Region comes, the region formed is not like the Path.
  It might be because the PathToRegion API first closes all the open figures and then converts the path into a region.If anybody can help me then I'll be obliged.I'm using the following code to make the path:


started = 0
Call BeginPath(Picture2.hdc)
For y = 1 To Picture1.ScaleHeight - 1
For x = 1 To Picture1.ScaleWidth - 1
If GetPixel(Picture1.hdc, x, y) Then
       If started = 0 Then
       Call MoveToEx(Picture2.hdc, x, y, POINT)
       started = 1
       End If
       Call LineTo(Picture2.hdc, x, y)
End If
Next x
Next y
Call EndPath(Picture2.hdc)
Call StrokePath(Picture2.hdc)


This code will just make the Path and draw it for you on the Picture2.Try to get a Monochrome picture in the Picture1.

Regards,
Misterxed...

____________________________
lOsT...

27-07-2005 at 04:11 PM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: Path To Region Error

Hi there,
Umm... I've found the solution for my lil problem at...
http://vbaccelerator.com/codelib/winstyle/bmpwinsh.htm


[Edited by misterxed on 06-08-2005 at 05:16 AM GMT]

____________________________
lOsT...

28-07-2005 at 11:00 PM
View Profile Send Email to User Show All Posts | Quote Reply
Asim-GDI GURU
Level: Sage

Registered: 29-07-2005
Posts: 54
icon Re: Path To Region Error

Hi there,
I'm very thankful to you mister xed for your valueable search that you made for me.As you know already I's working on this since many months.

Regards,
Asim Siddiqui.

29-07-2005 at 03:03 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : Path To Region Error
Previous Topic (System-wide hooks for Audio?)Next Topic (Draw a soft line) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder