Re: jpeg and Delphi 7

Shahab-o-ddin Mokhtari <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
Hi,
I was try this code and it was worked well on Delphi 7 (I was use VCL components, but I think that these are same!!!)
I know that it is not the best and most optimized code, but, it works well!!! :D
 
getFileExtension is my own function that return the extension of input file! just this!!!
 
Sorry for my weak english. :(
 
Regards
Shahab :)
 
-------------------------------------
procedure load;
begin
  if (LowerCase (getFileExtension (ImageAddr)) = 'jpg') or
     (LowerCase (getFileExtension (ImageAddr)) = 'jpeg')or
     (LowerCase (getFileExtension (ImageAddr)) = 'bmp') or
     (LowerCase (getFileExtension (ImageAddr)) = 'ico') or
     (LowerCase (getFileExtension (ImageAddr)) = 'emf') or
     (LowerCase (getFileExtension (ImageAddr)) = 'wmf') then begin
    if (LowerCase (getFileExtension (ImageAddr)) = 'jpg') or
       (LowerCase (getFileExtension (ImageAddr)) = 'jpeg')then
      FormX.Image1.Picture.RegisterFileFormat ('jpg', 'JPG Image', TJPEGImage)
    else if (LowerCase (getFileExtension (ImageAddr)) = 'emf') or
       (LowerCase (getFileExtension (ImageAddr)) = 'wmf') then
      FormX.Image1.Picture.RegisterFileFormat ('emf', 'Meta file Image', TMetafile)
    else if (LowerCase (getFileExtension (ImageAddr)) = 'bmp') then
      FormX.Image1.Picture.RegisterFileFormat ('bmp', 'Bitmap Image', TBitmap)
    else if (LowerCase (getFileExtension (ImageAddr)) = 'ico') then
      FormX.Image1.Picture.RegisterFileFormat ('ico', 'Icon Image', TIcon);
    FormX.Image1.Picture.LoadFromFile (ImageAddr);
...
end;
-----------------------------------------

Wildhemp <[email protected]> wrote:
Hi,

I'm  having problem to loading a jpeg in delphi 7. The RegisterFileFormat worked
on  Delphi 6, but in Delphi 7 I only get an access violation when I want to load
a  jpeg.  I've  called  RegisterFileFormat, and have registered the jpg's, but I
can't load one. Can somebody tell me why? I'm using clx components.


-- 
Wildhemp


Sincerely Yours
Shahab-o-ddin Mokhtari
 
[http://Ceramic81.150m.com]
[[email protected]]
[http://ShahabM.8m.com]


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.