Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

Saving TImages to memory

I have a TImage on my form. How do i save the TImage to the memory and then draw it directly from the memory to the form at the co-ordinates I want it at? (i.e. like the QBASIC Get() and Put() functions).
0
tim_nash
Asked:
tim_nash
  • 3
  • 2
1 Solution
 
kretzschmarCommented:
? just store it in the needed imageobject
(TBitmap for a bitmap for example)

use the bitblt-api to draw the image where you want
0
 
tim_nashAuthor Commented:
The image is a JPEG TImage. What would the code to do this be please (I am a newbie and am not sure how to work these things). I need two pieces of code:
1 piece Stores the image in the memory
1 piece draws the image from the memory to the correct co-ordinates
0
 
Stormmin66Commented:
add JPEG to uses

MyJPeg: TJPegImage;

MyJPeg := Image1.Picture.Graphic; // Load image
Form1.Canvas.Draw( 100, 0, MyJPeg ); // Draw image
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Stormmin66Commented:
could just save as bitmap as well, really doesn't matter, using TBitMap instead of TJPegImage.
0
 
Stormmin66Commented:
sorry bout above mees up.

should be MyJPeg := TJPegImage.Create;
MyJPeg.Assign( Image1.Picture.Graphic );
0
 
tim_nashAuthor Commented:
Perfect. The code I was planning on using was kinda fifty lines long whereas this is really easy to use as WELL as short. Thanx to stormmin66. Definately recommended.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now