Solved

Using TJPEGImage.Scale in Delphi 3

Posted on 2000-02-16
9
827 Views
Last Modified: 2008-03-03
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
Comment
Question by:michaelhiggins
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 2

Expert Comment

by:aubs
ID: 2527493
Look in delphi\help\examples\jpeg

Good luck

Aubs
0
 

Author Comment

by:michaelhiggins
ID: 2527562
Thanks, but I do not have a folder in \examples called jpeg.


Michael
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2527762
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!

 
LVL 3

Expert Comment

by:bryan7
ID: 2528197
he could better assign the jpg to a TImage so he can more easily handle it..
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2528243
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
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 2533210
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
 

Author Comment

by:michaelhiggins
ID: 2534692
Thanks for your comments - I will try them out this weekend.

Michael
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2543299
Any success?
0
 

Author Comment

by:michaelhiggins
ID: 2543625
Yes, It worked fine. Thanks

Michael

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 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