| View previous topic :: View next topic |
| Author |
Message |
Rimvydas Paulavicius Guest
|
Posted: Sat Mar 12, 2005 3:33 pm Post subject: Image.Picture.JpegBitmap |
|
|
How to convert JPEG imade loaded into TImage component to TBitmap?
Rimvydas
|
|
| Back to top |
|
 |
Joris Van Damme Guest
|
|
| Back to top |
|
 |
Rimvydas Paulavicius Guest
|
Posted: Sat Mar 12, 2005 7:09 pm Post subject: Re: Image.Picture.JpegBitmap |
|
|
Nor this
var
jpeg: TJPEGImage;
r: TBitmap;
begin
r := TBitmap.Create;
r.assign( Image1.Picture.Bitmap );
neither:
var
jpeg: TJPEGImage;
r: TBitmap;
begin
r := TBitmap.Create;
jpeg:= TJPEGImage.Create;
jpeg.assign( Image1.Picture.Bitmap );
r.Assign( jpeg );
does not work!
Rimvydas
Joris Van Damme wrote:
|
|
| Back to top |
|
 |
Anders Isaksson Guest
|
Posted: Sat Mar 12, 2005 8:07 pm Post subject: Re: Image.Picture.JpegBitmap |
|
|
Rimvydas Paulavicius wrote:
| Quote: |
var
jpeg: TJPEGImage;
r: TBitmap;
begin
r := TBitmap.Create;
r.assign( Image1.Picture.Bitmap );
does not work!
|
If you have loaded a jpeg into Image1.Picture there isn't any
Image1.Picture.Bitmap object to fetch as the .Graphic is a TJPEGImage. When
you access Image1.Picture.Bitmap a new, empty, bitmap will be created and
the jpegimage will be gone.
Try
r := TBitmap.Create;
r.Assign(Image1.Picture.Graphic);
instead. This should work with any type of graphic (bitmap, jpegimage,
pngimage, etc.)
--
Anders Isaksson, Sweden
BlockCAD: http://web.telia.com/~u16122508/proglego.htm
Gallery: http://web.telia.com/~u16122508/gallery/index.htm
|
|
| Back to top |
|
 |
Rimvydas Paulavicius Guest
|
Posted: Sun Mar 13, 2005 5:43 am Post subject: Re: Image.Picture.JpegBitmap |
|
|
YES,
thank You,
Rimvydas
Anders Isaksson wrote:
| Quote: | Rimvydas Paulavicius wrote:
var
jpeg: TJPEGImage;
r: TBitmap;
begin
r := TBitmap.Create;
r.assign( Image1.Picture.Bitmap );
does not work!
If you have loaded a jpeg into Image1.Picture there isn't any
Image1.Picture.Bitmap object to fetch as the .Graphic is a TJPEGImage. When
you access Image1.Picture.Bitmap a new, empty, bitmap will be created and
the jpegimage will be gone.
Try
r := TBitmap.Create;
r.Assign(Image1.Picture.Graphic);
instead. This should work with any type of graphic (bitmap, jpegimage,
pngimage, etc.)
--
Anders Isaksson, Sweden
BlockCAD: http://web.telia.com/~u16122508/proglego.htm
Gallery: http://web.telia.com/~u16122508/gallery/index.htm
|
|
|
| Back to top |
|
 |
|