Solved

transpose a bitmap

Posted on 2009-05-10
5
660 Views
Last Modified: 2013-11-22
I need a function to transpose ( flip and rotate CCW 90 deg ) a bitmap simply and fast. Any ideas?
0
Comment
Question by:IOOI
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:rfwoolf
ID: 24349419
Google is your friend:
http://www.delphi3000.com/article.asp?ID=2764

Procedure TurnImage(Src, Dst: TImage);
var x,y: integer;
begin
  Dst.Width:= Src.Height; Dst.Height:= Src.Width;
  For x:= 0 to Src.Width-1 do begin
    For y:= 0 to Src.Height-1 do begin
      Dst.Canvas.Pixels[(Src.Height-1)-y,x]:= Src.Canvas.Pixels[x,y];
    end;
  end;
end;

You can adapt this to do what you want.
0
 
LVL 13

Expert Comment

by:rfwoolf
ID: 24349439
Also, I actually couldn't go to that link when I found it in google - I had to check the Google cache.
But if you do go to the cache of that link you'll see  the above procedure PLUS improvements on it, stuff like being able to accept jpegs, being able to flip the image, being able to rotate it, and combinations thereof.
0
 

Author Comment

by:IOOI
ID: 24349442
I have googled a lot which is why I finally asked.

I'm aware of Canvas.Pixel but it is very slow because you can access individual pixels.

I was looking for a solution that uses scanline and simply switches x,y of individual pixels to get a transpose.
0
 
LVL 13

Accepted Solution

by:
rfwoolf earned 200 total points
ID: 24349611
If you haven't already, have a look at this page to see if there's a component or solution that might be able to help you: http://www.efg2.com/Lab/Library/Delphi/Graphics/ImageProcessing.htm
0
 

Author Closing Comment

by:IOOI
ID: 31579955
Thanks! I got a few ideas from that page.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Working with hours 3 45
Reconfigure Delphi Install? 2 45
Dynamically Created Query 3 48
Installshield for Embarcadero EX 10.1 Berlin 4 14
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now