Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7951553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:35:48+00:00 2026-06-04T02:35:48+00:00

I am doing just for fun a virtual desktop to play Magic The Gathering

  • 0

I am doing just for fun a virtual desktop to play Magic The Gathering with friends. I am using Delphi 2010. The cards are represented in the application by TImage components (loading PNG files of the cards loaded from a database). The point here is that in MTG a very common thing to do is to tap a card (rotating it 90º degrees to right). There is a simple way to do this? I really don’t need the “animation”, just the card rotated once is clicked (animation would be nice though). The game should work simultaneously with many cards and they can be moved anywhere in the form. I am thinking in having the image of the card tapped and untapped in the database but this may be an overkill if there is a nice and efficient way to rotate the cards.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:35:50+00:00Added an answer on June 4, 2026 at 2:35 am

    Or you can leave the TImage and use e.g. TPaintBox and GDI+ library. GDI+ has the RotateFlip method directly for doing this. Using the GDI+ Library for Delphi it would look like:

    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, ExtCtrls, ActiveX, GDIPOBJ, GDIPAPI;
    
    type
      TForm1 = class(TForm)
        Button1: TButton;
        PaintBox1: TPaintBox;
        procedure FormCreate(Sender: TObject);
        procedure FormDestroy(Sender: TObject);
        procedure Button1Click(Sender: TObject);
        procedure PaintBox1Paint(Sender: TObject);
      private
        FImage: TGPImage;
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.FormCreate(Sender: TObject);
    var
      Stream: IStream;
      BlobStream: TMemoryStream;
    begin
      BlobStream := TMemoryStream.Create;
      try
        // assuming the BlobStream here has a valid image loaded from a database
        Stream := TStreamAdapter.Create(BlobStream);
        FImage := TGPImage.Create(Stream);
      finally
        BlobStream.Free;
      end;
    end;
    
    procedure TForm1.FormDestroy(Sender: TObject);
    begin
      FImage.Free;
    end;
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      FImage.RotateFlip(Rotate90FlipNone);
      PaintBox1.Invalidate;
    end;
    
    procedure TForm1.PaintBox1Paint(Sender: TObject);
    begin
      with TGPGraphics.Create(PaintBox1.Canvas.Handle) do
      try
        DrawImage(FImage, 0, 0);
      finally
        Free;
      end;
    end;
    
    end.
    

    Such an overkill, doesn’t it 😕

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing just for fun an unread messages checker application in Delphi. I'm using
I'm doing a personal, just for fun, project that is using screen scraping to
I'm just doing a simple graph using Open Flash Chart http://teethgrinder.co.uk/open-flash-chart/ which shows the
Usually I was doing something like that (just a example): using (Stream xmlStream =
I'm writing a virtual machine in C just for fun. Lame, I know, but
I am working on a small webapp for fun, using just Java Servlets at
I'm doing a dots game on the iphone for fun ( just simulator) and
I'm developing a website(just for fun) and have been using mostly js/jquery to build
I am doing some population modeling (for fun, mostly to play with the concepts
I'm basically just doing some tests to figure out a good way to write

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.