473,387 Members | 1,476 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.

I am trying to rotate Device 90 Degrees from landscape to portrait with live preview

365 100+
I am trying to rotate Device 90 Degrees from landscape to portrait with live preview image, Image rotation not taking place, rotation method not working with Live preview Images of Landscape size 640x480 and portrait is 480x640, any idea?
Expand|Select|Wrap|Line Numbers
  1.  
  2. void OrientationTransform::RotateImage90(BYTE* data, int dataLength)
  3. {
  4.  
  5.     BYTE *dataTemp;
  6.  
  7.     dataTemp = new BYTE[dataLength];
  8.     memcpy(dataTemp, data, dataLength);
  9.  
  10.     BITMAPINFOHEADER bih = m_videoInfo.bmiHeader;
  11.     Bitmap bmp2(bih.biWidth, bih.biHeight, m_stride, m_pixFmt, dataTemp);
  12.     Bitmap bmp(bih.biWidth, bih.biHeight, m_stride, m_pixFmt, data);
  13.  
  14.     bmp2.RotateFlip(Rotate90FlipXY);
  15.  
  16.     Graphics g(&bmp);
  17.     g.Clear(Color::Black);
  18.  
  19.     g.ScaleTransform(bmp2.GetWidth(), bmp2.GetHeight() );  
  20.     g.DrawImage(&bmp2, 0, 0);
  21.     delete dataTemp;
  22. }
  23.  
May 11 '15 #1
0 1074

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

Similar topics

1
by: Bill Agee | last post by:
I would like to be able to specify the paper orientation from a subrountine from within VBA using the following command: Docmd.Printout formname
5
by: Patrick De Ridder | last post by:
How can I turn what I want to print 90 degrees using the logic below? Please tell me the code with which to make the modification. Many thanks, Patrick. using System.ComponentModel; using...
3
by: steve | last post by:
I have a tablet PC and I write a application on this tablet PC, I would like to rotate the screen from portrait<->landscape mode(or 90/180/270 degree), what should I do? I only find the code for...
3
by: James Radke | last post by:
Hello, How can I make the text of a windows textbox read vertically (i.e. rotated 90 degrees) from bottom to top instead of horizontally? Any samples or ideas would be appreciated! Thanks!...
1
by: yerk5 | last post by:
I'm trying to make use of one of those popular scripts you see all over the web these days, where you mouse over a image or link and you get a floating preview of something before you click it. ...
1
by: Carl1 | last post by:
I have a question regarding vertical text labels in the Reports area of Access 2000. In the properties area, selecting vertical text to "yes" rotates the text 90 degrees so that the text reads...
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.
4
by: sandra55 | last post by:
Hi, I am new to XSL and I am trying to print in landscape mode. I have tried many different things but yet none of them have worked. This is one of the codes I tried but it seems like it...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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.