473,498 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mirror / rotate image ( System.Drawing.Graphics / System.Drawing.Drawing2D.Matrix)

Hello list,

I have code the draw MyDrawingObject information on a
System.Drawing.Graphics object. The code is more/less the following:
void MyDrawingObject::Draw(ref System.Drawing.Graphics graphics, ref WindowDrawer windowdrawer)
{
if(_mirror || _rotate != 0) {
// do something here?
}
foreach (drawelements.DrawElement element in _drawelements)
{
if (windowdrawer.LayerActive(element.Layer))
{
element.Draw(ref graphics, ref windowdrawer, _location);
}
)
}
I now want to rotate / mirror the object i draw.
I've looked at the System.Drawing.Drawing2D.Matrix, which can be applied
on the Transform property of the Graphics object, but it will work on
the complete graphics object and there is no mirror method in it.
Can somebody help me do this / give me some pointers?

--
Eduard Witteveen
+31 (0)6 414 789 23
nl_NL fy_NL en_US
Jul 13 '06 #1
3 6694
To mirror an image, first you need to decide whether to mirror it
horizontally or vertically. Once you've done that, you simply draw it a
pixel at a time (use an unsafe code block), in reverse order of rows or
columns.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
"Eduard Witteveen" <ne**@nerNOSPAMgens.orgwrote in message
news:44***********************@news.euronet.nl...
Hello list,

I have code the draw MyDrawingObject information on a
System.Drawing.Graphics object. The code is more/less the following:
>void MyDrawingObject::Draw(ref System.Drawing.Graphics graphics, ref
WindowDrawer windowdrawer) {
if(_mirror || _rotate != 0) {
// do something here?
}
foreach (drawelements.DrawElement element in _drawelements)
{
if (windowdrawer.LayerActive(element.Layer))
{
element.Draw(ref graphics, ref windowdrawer, _location);
}
)
}

I now want to rotate / mirror the object i draw.
I've looked at the System.Drawing.Drawing2D.Matrix, which can be applied
on the Transform property of the Graphics object, but it will work on the
complete graphics object and there is no mirror method in it.
Can somebody help me do this / give me some pointers?

--
Eduard Witteveen
+31 (0)6 414 789 23
nl_NL fy_NL en_US

Jul 13 '06 #2
Kevin Spencer schreef:
To mirror an image, first you need to decide whether to mirror it
horizontally or vertically. Once you've done that, you simply draw it a
pixel at a time (use an unsafe code block), in reverse order of rows or
columns.
And i should do the rotation in this same step?
Furthermore, arent their any 3th party libs which i could use?

ps: changed subject...
Jul 17 '06 #3
Kevin Spencer schreef:
To mirror an image, first you need to decide whether to mirror it
horizontally or vertically. Once you've done that, you simply draw it a
pixel at a time (use an unsafe code block), in reverse order of rows or
columns.
And i should do the rotation in this same step?
Furthermore, arent their any 3th party libs which i could use?

ps: changed subject...
Jul 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2373
by: news.microsoft.com | last post by:
Hello group, My goal is to attach an image over another image. Top image should be transparent so the back image is visible through the top one. Bellow is a test code in VB.NET. You need to...
1
9556
by: Paul Hoad | last post by:
I'm trying to use MeasureString() to determine the length in pixels of a string However to do I need a System.Drawing.Graphics object to do this I need to create a System.Drawing.Graphics...
4
4507
by: Peter Oliphant | last post by:
There doesn't seem to be any documentation on how to create and/or use an instance of System::Drawing::Graphics. On-line MSDN talks about this class, and says: " The Graphics class provides...
3
2557
by: Peter Oliphant | last post by:
I'm importing a jpeg via: Bitmap* image = new Bitmap( filename ) ; Then, using the Drawing::Graphics object, I execute DrawImage( image, x, y ). My problem is that the original image was...
1
3209
by: Hadar | last post by:
Hi, I'm getting "object is currently in use elsewhere" when I use System.Drawing.Graphics.MesureString. This is what I do: My controls use a utility class the helps it to mesure strings. To...
5
2481
by: Steve Marshall | last post by:
Hi all, I am converting an app which used a picturebox to draw graphs etc onto, then saved them to a file. I can certainly draw things onto a picturbox in VB.NET, but how do I save them to a...
11
9256
by: cty0000 | last post by:
I have some quiestion... I want to draw line,point,rectangles and etc... on the from So I code like this.. public update() { g = this.CreateGraphics(); g.FillRectangle(Brushes.White, x1,...
6
3201
by: swethak | last post by:
Hi, I displayed the image taken from database.How to raotate that image using javascript.plz tell that how to start the logic.plz tell that some reference websites.
1
2283
by: Nilla2010 | last post by:
Hi, I would like to rotate image on mouse event.If i move the image left side by mouse it should rotate on left side and vice versa. Thanks in advance
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.