DrawImage equivalent in WPF ?

mikkevin

Member
Joined
Nov 5, 2009
Messages
10
Programming Experience
10+
I'm trying to figure out a way to do things the way DrawImage could do in WinForms. I want to be able to draw several images on the form surface or on an image control, with the images overlapping each other and at the same time being able to draw only a part of the source image. How do I do it ? I could use one of the overrides of DrawImage and draw only a portion of the source image over another image without actually erasing the background of the control.

To give an example, say you've two images Image1 and Image2. You draw Image1 on the screen and now, you draw only a part of the Image2 (say a small rectangular part from the centre of Image2) onto Image1 which, would cover only a part of Image1 i.e. wihtout actually erasing the already drawn Image1.

How would you go about it -
1. You want Image2 and Image1 both to be opaquely drawn.
2. You want to draw Image1 opaque and draw Image2 with partial transparency to cover a part of Image1 so that, Image1 shows thru' Image2 ?

Any help would be greatly appreciated.

Thanks.
 

Latest posts

Back
Top