• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 880
  • Last Modified:

Using TJPEGImage.Scale in Delphi 3

I want to use the scale feature of TJPEGImage to display a thumbnail image. However, I can't seem to get it to work, where ever I put it. Has anyone used this feature sucessfully?

0
michaelhiggins
Asked:
michaelhiggins
1 Solution
 
aubsCommented:
Look in delphi\help\examples\jpeg

Good luck

Aubs
0
 
michaelhigginsAuthor Commented:
Thanks, but I do not have a folder in \examples called jpeg.


Michael
0
 
EpsylonCommented:
I'm not sure if all this works in Delphi 3 but give it a go.


Uses JPEG;

procedure TForm1.Button1Click(Sender: TObject);
var j: TJPEGImage;
    b: TBitmap;
begin
  b := TBitmap.Create;
  j := TJPEGImage.Create;
  j.LoadFromFile('spidersm.jpg');
  j.Scale := jsQuarter;
  b.Assign(j);
  Canvas.Draw(100, 100, b);
  j.Free;
  b.Free;
end;
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bryan7Commented:
he could better assign the jpg to a TImage so he can more easily handle it..
0
 
EpsylonCommented:
That is a possibility.

  j := TJPEGImage.Create;
  j.LoadFromFile('spidersm.jpg');
  j.Scale := jsQuarter;
  Image1.Picture.Bitmap.Assign(j);
  j.Free;


It's just what you want to do with it...
0
 
EpsylonCommented:
Uses JPEG;

procedure TForm1.Button1Click(Sender: TObject);
var j: TJPEGImage;
    b: TBitmap;
begin
  b := TBitmap.Create;
  j := TJPEGImage.Create;
  j.LoadFromFile('spidersm.jpg');
  j.Scale := jsQuarter;
  b.Assign(j);
  Canvas.Draw(100, 100, b);
  j.Free;
  b.Free;
end;
0
 
michaelhigginsAuthor Commented:
Thanks for your comments - I will try them out this weekend.

Michael
0
 
EpsylonCommented:
Any success?
0
 
michaelhigginsAuthor Commented:
Yes, It worked fine. Thanks

Michael

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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