473,657 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rotating a Graphic

I have a Graphics object that I have drawn several things on using transform
methods (such as RotateTransform and TranslateTransf orm) and drawing methods
(such as FillRectangle and DrawString) of the Graphics object. It now looks
exactly how I want, except for one thing. I want to rotate the entire thing
by 180 degrees. How can I do this? I think there is something with the
SetClip method or something, but since I don't have a ton of experience with
the Graphics class, I may need some help. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Oct 28 '08 #1
1 1310

"Nathan Sokalski" wrote:
I have a Graphics object that I have drawn several things on using transform
methods (such as RotateTransform and TranslateTransf orm) and drawing methods
(such as FillRectangle and DrawString) of the Graphics object. It now looks
exactly how I want, except for one thing. I want to rotate the entire thing
by 180 degrees. How can I do this? I think there is something with the
SetClip method or something, but since I don't have a ton of experience with
the Graphics class, I may need some help. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Hi Nathan,

You can add a Rotate and Translate at the top of the graphics manipulation

e.Graphics.Rota teTransform(180 );
e.Graphics.Tran slateTransform( ClientRectangle .Width, ClientRectangle .Height,
MatrixOrder.App end);

Any drawing from here on will be upside down

--
Happy Coding!
Morten Wennevik [C# MVP]

Oct 28 '08 #2

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

Similar topics

4
2401
by: Ian Hubling | last post by:
I'm trying to complete a rotating banner ad within a page I have. The rotating add has four images that rotate in three-second increments. I've got the images to rotate ok - but now I want to go one step further and can't figure out how to do it... I want to have it so that when the person clicks on the specific ad, they are taken to a URL that is unique to each ad. I presume I would have to surround the img tag with an href tag, but...
1
3214
by: Sandy Bremmer | last post by:
I have seen many Javascripts that rotate images with each load or refresh of the page but so far all I've found require hard coding the image filename into the script. Does anyone know of a script that pulls images randomly from a directory? Thus I would need only add (or delete) images from that directory and they would display on the web page respectively. All the images are the same size (90x90) but there are hundreds so hard coding...
1
2102
by: Grunt | last post by:
Hi, I have been trying to put together a rotating banner. the code works but I am having a problem with the caching of the banner images. no matter what I try the page is constantly reloading the images, even worse they are not loading completely. This version includes a (vain) attempt at forcing the banner images to cache. Apart form the caching problem the scripting seems to work Any help welcomed:
4
5452
by: Roozbeh GHolizadeh | last post by:
Hi there... i think it is a very common problem but i dont know why i didnt find anything good for me on internet... i want to simply rotate an array with 90,180,270 degrees.... here is how i allocated this.... srcimage = (LPBYTE)LocalAlloc(LMEM_FIXED, 320 * 200);
0
1149
by: dgk | last post by:
A friend wants to have two circles containing letters. One would be stationary and the other would rotate around the first one. I know how to get the graphic form thingie from the Form Paint event argument and can see how to create concentric circles that would form the stationary circle, but I don't know how to make a circle rotate except by constantly repainting it. That seems like a bad approach. I suppose it can be done with images...
0
935
by: Sukhdev Sembhi | last post by:
I am trying to rotate all graphic objects in a word document if the object is wider than a specified width. I can successfully locate and find out the width but I can not rotate it. Sub ImageToLandscape() Dim intWidth As Integer Selection.Find.ClearFormatting With Selection.Find
3
5951
by: avalence | last post by:
Hello, I am trying to create a nice rotating earth globe (on mouse) on my web site, in order to display my professional relationships all over the world. The best way seems to be a javascript. In fact I still hesitate between java and javascript. My question is how can I create a interacting globe using a satellite photo. This is a very usefull applet for everybody. All suggestion welcome! Thanks Arnaud
1
2562
by: AR123 | last post by:
Hi I want to set up a rotating banner. Not sure how to incorporate my rotating banner code into the code below. I want the rotating banner to be the main feature image? This is set up in mediasurface My code is: <!-- start page container --> <div id="pageContainer"> <!-- start middle content area --> <div id="genericMiddle">
7
3181
by: J-Burns | last post by:
Hello. Need some help here. I have a 4*4 cube. So the equation of the cube becoming: x + 4*y + 16*z Now i want to rotate this cube 90 degrees anticlockwise( a right rotation). How can i do that? The rotation must take place with the axis of rotation being the straight line through the center of the cube and perpendicular to the "xz-plane." The axis are aligned in this fashion:
8
1934
by: Syoam4ka | last post by:
Hi, I have a WinApp in which I have a pictureBox. I can draw in it like in the paint of windows - I accomplish that with an arrayList of Points and DrawLines method of the Graphics. So it really paints like in the Paint of windows. When I let the mouse left button up it stops drawing of course. Now I want to rotate that paint (which is actually drawn lines isn't it)? I have a button - btnRotateToLeft and another button -...
0
8397
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7333
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6167
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1620
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.