Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, September 20, 2010 4:49:59 AM(UTC)

Whitey  
Whitey

Groups: Registered
Posts: 7


Hello All,
I'm having trouble getting a good answer from support, to I'm trying the general public.  The lack of WPF floaters has proven cumbersome on my developing a photo editing tool.  I've been able to clone a rectangle into a new Image control and then make it a virtual floater.  I can then scale, rotate, and translate, and save the final product to a new jpg using RenderTargetBitmap.

I am now trying to do something similar with an ellipse, and eventually a polygon.  I know that on a real level, I have to deal with the image object as a rectangle.  However, on a virtual level I would like the "floater" to appear to be the unique shape by making the areas outside transparent. 

Any help would be great,
Noah
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, September 20, 2010 5:45:50 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

The object you're using (overLay) is not a LEADTOOLS control, but I found a way to apply the desired effect.
At the beginning of the cmdGetStats_Click() function in your project, I was able to define an elliptical clip area using this code:
overLay.Clip = new EllipseGeometry(new Rect(0, 0, overLay.ActualWidth, overLay.ActualHeight));

You could use other types of geometry such as a more complex PathGeometry.
 
#3 Posted : Tuesday, September 21, 2010 4:05:37 AM(UTC)

Whitey  
Whitey

Groups: Registered
Posts: 7


I can get the region defined as part of a larger image.  Your example does not free the copied pixels to keep their shape in a new, separate image. 
 
#4 Posted : Tuesday, September 21, 2010 4:25:16 AM(UTC)

Whitey  
Whitey

Groups: Registered
Posts: 7


Also, you say that my control is not a Lead control.  Earlier you told me that a Lead control would not work for what I wanted to do, since it was not robust enough to include floaters. 
I only made my own control to hack together a way to use some of your functions to achieve a floater in WPF, something that you didn't see fit to including in some expensive software.  So, if you would please, show me how (in code)  to do the following using your control and functions:
1.  Load an image into a WPF form.
2.  Draw an ellipse, or polygon on the loaded image.
3.  Copy that ellipse or polygon region into a new image in its own control, with the area outside of the shape transparent.
4.  Move that region around, and recombine it.

This is functionality that you, to some degree, considered a fundamental addition to the ActiveX controls.  Feel free to show me how this works using your control.  I would rather use what I've paid for than find a work around.

I eagerly wait your completed sample, so that I might apologize.
Noah White
 
#5 Posted : Tuesday, September 21, 2010 5:37:52 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Noah,
I modified your project to display the overlay floater as ellipse from the beginning so that it gets drawn without the edges. I'm attaching the modified project; is this what you want?

Please note that there are advanced features in our WPF which can be used to produce a similar effect, but they are only available in the more expensive toolkits (Document and Medical). Using annotations, you can put an image in a stamp object and move it over the main image. You can then render it to make it part of the image.
File Attachment(s):
WPFMorph.zip (15kb) downloaded 27 time(s).
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.111 seconds.