How do you crop an image in Expression Blend?

I know that this is more inclined towards the design question, but since I was faced with the development of something that requires me to crop the image, I thought I would give the question a shot.

This seems like a ridiculous question to ask, but I looked through the entire IDE (Expression Blend 2) to try and find a way to crop the image, but I can't figure it out.

This seems to be very similar to Joel's question and is discussed in Podcast 58 in the sense that I'm a complete noob when it comes to designing in Expression Blend. I am inexorably interested in figuring out the most effective way to do this. I found an article that describes the workflow that you can go through and will produce a crop, which I added as an answer below, but I'm really hoping that someone else will find out about this faster (fewer clicks) a way to do something- then as trivial as that.

Does anyone know how to do this?

+4
source share
2 answers

As far as I know, there is no way to crop the image directly in the Blend expression. Blend is not an image editing application. To do this, you need another tool.

What you can do is crop the image if you want to show part of it. Just add a rectangle on top of it, right-click it, go to path → make a clipping path. alt text http://img200.imageshack.us/img200/7370/example1.jpg

Now select the System.Windows.Controls.Image entry from the list to which you want to trim, and click Ok

You can even use rounded rectangles, circles, and custom paths for the clip, but in most cases the rectangle will do the trick.

Just ran into another way . Look at the question . It uses CroppedBitmapClass as the image source. This is not the actual drawing in Blend, but you can add it manually by editing Xaml. It is not clear from your question whether you are building a Silverlight or a WPF application in Expression Blend. CroppedBitmapClass is only available in WPF.

With the new Silverlight 3, you can use WritableBitmap to create crop images:

+5
source

I found an article in which there are steps to crop the image, but it took a long time to make such a simple operation. You would think that something that MS Paint can do in a couple of clicks would be just as easy in Blend.

Here is the link.

I'm still wondering if there is an easier way to do this.

Another problem with this approach is that afterwards I cannot resize the rectangle with which I crop the image, which I need to do because I need the image to have the exact number of pixels in width and height.

0
source

Source: https://habr.com/ru/post/1286321/


All Articles