Board index » delphi » BMP / JPEG images

BMP / JPEG images

Hi all,

Could someone please help me as to how to break up a JPEG image
into say 2 halves and save each half as separate JPEG files.
Currently I can only break up BMP images using :-
      form1.Canvas.CopyRect (Rect1, image1.Canvas, Rect2);
and saving the separate BMP halves as BMP files. Or is it possible
at least when saving the BMP image, to save it as a JPG file?
Would I need and is there any third party components that could
do the above?

I would appreciate any help and or suggestions.
thanks and regards
jono
jguna...@csc.com.au

 

Re:BMP / JPEG images


In article <377f61c...@pink.one.net.au>,
  "Jono" <jon...@one.net.au> wrote:

Quote
> Hi all,

> Could someone please help me as to how to break up a JPEG image
> into say 2 halves and save each half as separate JPEG files.
> Currently I can only break up BMP images using :-
>       form1.Canvas.CopyRect (Rect1, image1.Canvas, Rect2);
> and saving the separate BMP halves as BMP files. Or is it possible
> at least when saving the BMP image, to save it as a JPG file?
> Would I need and is there any third party components that could
> do the above?

     There's a TJPEGImage included with current versions of
Delphi (where to look depends on what version you have).
You can simply load your jpg into a TJPEGImage, Assign that
to a TBitmap, split the bitmap in two pieces (using the
bitmap's canvas.CopyRect, no need to display anything on a
form), then Assign the two halves back to TJPEGImages and
save to file.

Quote
> I would appreciate any help and or suggestions.
> thanks and regards
> jono
> jguna...@csc.com.au

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

Other Threads