BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Image.Picture.JpegBitmap

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Rimvydas Paulavicius
Guest





PostPosted: Sat Mar 12, 2005 3:33 pm    Post subject: Image.Picture.JpegBitmap Reply with quote



How to convert JPEG imade loaded into TImage component to TBitmap?

Rimvydas

Back to top
Joris Van Damme
Guest





PostPosted: Sat Mar 12, 2005 6:29 pm    Post subject: Re: Image.Picture.JpegBitmap Reply with quote



Quote:
How to convert JPEG imade loaded into TImage component to TBitmap?

There seems to be a lot of confusion about this. Here's an attempt at clear
explanation:

http://www.awaresystems.be/techtalks/003_graphic_picture_image.html

Joris Van Damme
[email]info (AT) awaresystems (DOT) be[/email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html



Back to top
Rimvydas Paulavicius
Guest





PostPosted: Sat Mar 12, 2005 7:09 pm    Post subject: Re: Image.Picture.JpegBitmap Reply with quote



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:

Quote:
How to convert JPEG imade loaded into TImage component to TBitmap?

There seems to be a lot of confusion about this. Here's an attempt at clear
explanation:

http://www.awaresystems.be/techtalks/003_graphic_picture_image.html

Joris Van Damme
[email]info (AT) awaresystems (DOT) be[/email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html


Back to top
Anders Isaksson
Guest





PostPosted: Sat Mar 12, 2005 8:07 pm    Post subject: Re: Image.Picture.JpegBitmap Reply with quote

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





PostPosted: Sun Mar 13, 2005 5:43 am    Post subject: Re: Image.Picture.JpegBitmap Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.