I have an image with a certain pattern. How do I repeat it in another image using GDI?
Is there any method to do it in GDI?
I have an image with a certain pattern. How do I repeat it in
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In C#, you can create a TextureBrush that’ll tile your image wherever you use it, and then fill an area with it. Something like this (an example that fills the whole image)…
Note, if you want some control over how the image is tiled, you’re going to need to learn a bit about transforms.
I almost forgot (actually I did forget for a bit): You’ll need to import
System.Drawing(forGraphicsandTextureBrush) andSystem.Drawing.Drawing2D(forWrapMode) in order for the code above to work as is.