473,396 Members | 1,814 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,396 software developers and data experts.

Rotate the image

Hi,

I have a Image data which retrieving from Camera device. Now that data has mirror position. Now I need to rotate that image data as usual position.

Anybody knows that please give an example or reference website.

Thank you
Dec 14 '07 #1
5 7915
sicarie
4,677 Expert Mod 4TB
Well, you could look for some sort of rotate function in a library, and use that, or you could write a function to move it yourself, as if you're rotating 180 degrees, you're taking the pixel in (1,1( and moving it to (max,max) - and conversely, (max,max) to (1,1)...

So I'd pick one of those, and then try it - that's the best way to learn it.
Dec 14 '07 #2
Well, you could look for some sort of rotate function in a library, and use that, or you could write a function to move it yourself, as if you're rotating 180 degrees, you're taking the pixel in (1,1( and moving it to (max,max) - and conversely, (max,max) to (1,1)...

So I'd pick one of those, and then try it - that's the best way to learn it.

Thanks for your reply.

Actually I am new person to the vc++. So I could not write the code for taking the pixel one by one.

Can you have any simple example in c or c++ or vc++6.0? Please give.
Dec 15 '07 #3
sicarie
4,677 Expert Mod 4TB
Thanks for your reply.

Actually I am new person to the vc++. So I could not write the code for taking the pixel one by one.
You could, actually, and you would learn a lot doing it. The only thing keeping you from doing it is your attitude that you think you can't.
Can you have any simple example in c or c++ or vc++6.0? Please give.
Nope. Sorry. But if you Google search 'c++ graphics library' the more popular ones will have good documentation and you can figure out how to use them pretty easily.
Dec 15 '07 #4
Studlyami
464 Expert 256MB
or search for rotating bitmap mfc (or replace mfc with vc++) and you will find several links within the top 10 that will have full code examples of how to do this. Do a little bit of research and try it out. If it doesn't work right post up where you are having a problem and your code that relates to the problem.
Dec 16 '07 #5
or search for rotating bitmap mfc (or replace mfc with vc++) and you will find several links within the top 10 that will have full code examples of how to do this. Do a little bit of research and try it out. If it doesn't work right post up where you are having a problem and your code that relates to the problem.

I have retrieved the image data from the camera device. Now I need to rotate that image data using gdi+. I have using following code for rotating the image.



void RotFlipImg::FlipImgData(char* mydata,prUInt32 imgsize)

{

FILE *fptr1;

fptr1=fopen("liveimage.jpg","wb");

fwrite(mydata,imgsize,1,fptr1);

fclose(fptr1);


GdiplusStartupInput gdiplusStartupInput;

ULONG_PTR gdiplusToken;

GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

Bitmap* bitmap = new Bitmap(L"liveimage.jpg");

bitmap->RotateFlip(RotateNoneFlipX);

bitmap->Save(L"FlipImage.jpg",&guidBmp);

delete bitmap;

}



In above code, I write that data into "liveimage.jpg" after rotate liveimage.jpg to FlipImage.jpg. It will becomes late. So I have to directly rotate the image data(mydata).



How can I rotate the image as stream data without using direct image?.
Dec 18 '07 #6

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

Similar topics

6
by: Leo Koolsbergen | last post by:
Hallo, Maybe a very simpel problem, but I cannot find a solution. From a webcam I can retreive pictures, but as the cam is positioned upside down I have to rotate the (jpeg) pictures. I've...
7
by: Showjumper | last post by:
Hi, I have developed an upload server controls to be reused over a number of projects. One of the tasks it needs to handle is to rotate an image. I want to accoplish this by checking the checkbox...
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...
8
by: Samuel Shulman | last post by:
Is it possible and how to rotate pictures in HTML document Thank you, Samuel
3
by: Diego F. | last post by:
Hi all. I have a listview with images and my application must be able to rotate one image. I need a method to rotate 90 degrees rigth (i.e.). Is that possible? -- Regards, Diego F.
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...
2
by: Dariusz.Donimirski | last post by:
I must rotate bmp using Xlib without change bmp's memory. If someone knows how I can do this, please help me. dariusz sorry about my english, I'm still learning
1
Thekid
by: Thekid | last post by:
Hi, I have an image similar to a clock, with numbers and letters going around in a circle. I need to extract the numbers and letters from the image and have them print out in a straight line and in...
0
by: harryusa | last post by:
I am experimenting with the rotate function and so far I can't get my code to return anything but the URL of my script. Here it is: <?php // The file you are rotating $image =...
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:
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.