Solved

Using TJPEGImage.Scale in Delphi 3

Posted on 2000-02-16
9
788 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
9 Comments
 
LVL 2

Expert Comment

by:aubs
Comment Utility
Look in delphi\help\examples\jpeg

Good luck

Aubs
0
 

Author Comment

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


Michael
0
 
LVL 13

Expert Comment

by:Epsylon
Comment Utility
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
 
LVL 3

Expert Comment

by:bryan7
Comment Utility
he could better assign the jpg to a TImage so he can more easily handle it..
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 13

Expert Comment

by:Epsylon
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for your comments - I will try them out this weekend.

Michael
0
 
LVL 13

Expert Comment

by:Epsylon
Comment Utility
Any success?
0
 

Author Comment

by:michaelhiggins
Comment Utility
Yes, It worked fine. Thanks

Michael

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

11 Experts available now in Live!

Get 1:1 Help Now