I am trying to access files that are stored as Jpeg files, is there an easy way to display these image files without performance loss ?
I found this page!
http://cc.embarcadero.com/Item/19723
Enhanced jpeg implementation
Author: Gabriel Corneanu
This unit contains a new jpeg implementation (based on Delphi original)
You only need the jpeg.dcu file; it can be copied to program directory or to the LIB directory.I generated obj and hpp files for use with CBuilder 5 and 6 also.This is what you need to use it:
This is just an enum
TJpegTransform = (
jt_FLIP_H, { horizontal flip }
jt_FLIP_V, { vertical flip }
jt_TRANSPOSE, { transpose across UL-to-LR axis }
jt_TRANSVERSE, { transpose across UR-to-LL axis }
jt_ROT_90, { 90-degree clockwise rotation }
jt_ROT_180, { 180-degree rotation }
jt_ROT_270 { 270-degree clockwise (or 90 ccw) }
);
procedure Crop(xoffs, yoffs, newwidth, newheight: integer);
this method is cropping the image
procedure Transform(Operation: TJpegTransform);
this method is applying the specified transformation; read the transupp.h comments about limitations(my code is using crop option)
property IsCMYK: boolean read FIsCMYK;
this will indicate if the last jpeg image loaded is CMYK encoded
property InverseCMYK: boolean read FInverseCMYK write SetInverseCMYK;
if set (default, because I could only find this kind of images), the CMYK image is decoded with inversed CMYK values (I read that Photoshop is doing this).
The jpegex is the same unit compiled with a different name. It can be used to avoid conflicts when you have other components without source code linking to the original jpeg unit. In this case you might need to use qualified class names to solve names conflict: jpegex.TJpegImage.xxx. Be carefull when you use both versions in one program: even though the classes have the same name, they are not identical and you can't cast or assign them directly. The only way to exchange data is saving to/loading from a stream.
Send comments to: gabrielcorneanuATyahooDOTcom