473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to rotate an image by 180 degree clockwise and counterclockwise using C codes?

I need help in C program in order to rotate any image clockwise and anticlockwise.

I searched a lot on net but couldn't able to find any solution.
Mar 15 '10 #1
4 9927
newb16
687 512MB
Does cw and ccw rotation differ in case of 180 degrees? Anyway, after you read the image from file and stored it in the array of pixels, swap appropriate pixels values for the whole array.
Mar 15 '10 #2
donbock
2,426 Expert 2GB
What is the format of the image?
Mar 15 '10 #3
image is in jpeg and size is 160*120. Please suggest me algorithm so that i can build some codes.. In image processing i am very new.
Mar 15 '10 #4
jkmyoung
2,057 Expert 2GB
As an opening, slow method, I suggest you first

Convert the jpg into a 160x120 set of pixels.
Rotate them accordingly, eg (i,j) -> (160-i, 120-j).
Convert the pixels, back into a jpg.

Once you've done this, you should be able to see a refinement in your method.
Mar 15 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mullin Yu | last post by:
I can create an image object with a string printed on it. But, how I can rotate the whole image 270 degree clockwise static public Bitmap createSerial() { Graphics objGraphics; string...
17
by: santel_helvis | last post by:
Hi All, Could anyone tell me how to rotate the image in javascript. Which concepts I should concentrate to rotate the image
1
by: iwdu15 | last post by:
hi, im trying to rotate a gdi drawn object on my form with a keypress....forinstance when i push the down arrow, for it to rotate the object drawn until the top is down, or if i push the right...
1
by: Yannick Benoit | last post by:
Anyone know a function that could rotate a .jpg image 90 degree to the right or left ? thanx
8
by: lovecreatesbeauty | last post by:
I write a function to rotate a matrix by 90 degrees clockwise, this function works on a matrix of specific size, for example, it rotates a 4*4 matrix of integers in the following code. The function...
8
by: Samuel Shulman | last post by:
Is it possible and how to rotate pictures in HTML document Thank you, Samuel
10
by: Joey_Stacks | last post by:
Does anyone know of a scipt that will rotate random div layers on page refresh? I have a primary content area front and center on my site homepage, and I'd like to rotate various chunks of html...
5
by: Gina_Marano | last post by:
Hey All, Is it possible to draw an image upside down? I am using Microsofts example of "Printing a local report without preview". The only trick is that I want to flip the image upside...
1
by: vps | last post by:
Choosing 'Rotate' on the properties tab spins an object vertically, e.g. 90° clockwise. But how do I rotate it horizontally? An example is http://www.teknicks.com/Flash/header2.swf (the green...
4
by: LTCCTL | last post by:
Hi all, I have an image on a web page. I need to rotate the image in a clockwise direction every second. Please let me know how we can do it. Regards LTCCTL
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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
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...

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.