C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[711] [정보] BMP => JPEG conversion/프포
xgen [ ] 5857 읽음    1998-11-11 21:20

TI3332 - Converting a BMP to a JPEG and Vice Versa

Product: Delphi
Version: All
Platform: Windows/Win32



Q: How do I convert a BMP to a JPEG and vice versa?

A: This little project demonstrates how to do it using the JPEG components that
   ship with Delphi 3 (in the INFO\EXTRAS\JPEG directory). Just start a brand
   new project in Delphi 3. Drop two TButtons on the form. Then double click on
   the first button. Then double click on the second button. (This hooks the
   event handlers up). Finally, replace the code inbetween "{$R *.DFM}" and
   "end." in Unit1 with this code:

uses
  JPEG;

procedure TForm1.Button1Click(Sender: TObject);
var
  MyJPEG : TJPEGImage;
  MyBMP  : TBitmap;
begin
  { Convert a BMP to a JPEG }

  MyBMP := TBitmap.Create;
  with MyBMP do
    try
      LoadFromFile('YourBmpHere.BMP');
      MyJPEG := TJPEGImage.Create;
      with MyJPEG do begin
        Assign(MyBMP);
        SaveToFile('YourJpegHere.JPEG');
        Free;
      end;
    finally
      Free;
    end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  MyJPEG : TJPEGImage;
  MyBMP  : TBitmap;
begin
  { Convert a JPEG to a BMP }

  MyJPEG := TJPEGImage.Create;
  with MyJPEG do begin
    LoadFromFile('YourJpegHere.JPEG');
    MyBMP := TBitmap.Create;
    with MyBMP do begin
      Width := MyJPEG.Width;
      Height := MyJPEG.Height;
      Canvas.Draw(0,0,MyJPEG);
      SaveToFile('YourBmpHere.BMP');
      Free;
    end;
    Free;
  end;
end;




--------------------------------------------------------------------------------
DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.
--------------------------------------------------------------------------------


inprise 홈페이쥐에 갔더니 이런 FAQ가 있더군요.. 누구 GIF에 관한거 본적 있으신분

안계시나요??? 흑흑흑!!! 점점 급해지는데...



+ -

관련 글 리스트
709 [질문] 그래픽파일 포맷 변환.../프포 xgen 6080 1998/11/11
711     [정보] BMP => JPEG conversion/프포 xgen 5857 1998/11/11
714     [답변] XGEN/ 그래픽파일 포맷 변환.../프포 박지훈.임프 5987 1998/11/12
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.