VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 12[3]45678910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 20:13:34 09/17/03 Wed
Author: Michel
Subject: Re: ImageScrollBox and TJpegImage
In reply to: Stampfli Heinz 's message, "Re: ImageScrollBox and TJpegImage" on 15:16:48 09/17/03 Wed


Hi Heinz,

>When I try to compile it. It gives an Error:
>"Incompatible types: TDipGraphic and TJpegImage"

This is my error.

ImageScrollBox.Graphic.Assign(JpegImage)

should work.

TGraphic is the VCL base class for all graphic. TBitmap, TJpegImage is derived from TGraphic. TDibGraphic is the base Envision class, derived from TGraphic. All Envision graphic classes are derived from TDibGraphic.

TDibGraphic.Assign() will accept any TGraphic derived class, so it should work with TJpegImage. I don't recall trying it so let me know how it goes.

>
>I have rewritten the Function
>ExtractThumbnailJpeg() that it uses TJpegGraphic
>within the Library EnJpgGr. When I try to load,
>nothing happens (no error).

Just as a test, if you try

ExtractThumbnailJpeg.SaveToFile('c:\testfile.jpg') is the resulting file a valid JPEG file?

>
>What is the diffrent from TDipGraphic and TGraphic.
>Can I convert them from one to the other?

See my comment above. You can use TDibGraphic.Assign(...) with any TGraphic derived class.

>
>When I load a JPEG into a TImage I also can't assign
>it to a TImageScrollBox.

You can try this,

ImageScrollBox.Graphic.Assign(Image.Picture.Graphic);

>
>Without Envision (only with the unit jpeg) dEXIF does
>work together with TImage to load the extracted
>Thumbnail.
>
>I would program the whole Application with Envision
>Library.

If you are still having problems, the best way for me to help you would be to send me a small sample project, that has all the necessary source files.

Best regards,

Michel



>
>
>>Hi Heinz,
>>
>>I have not used dEXIF so I may need more information.
>>
>>Does,
>>
>>function TImgData.ExtractThumbnailJpeg: TJpegImage;
>>
>>work properly?
>>
>>You can try this,
>>
>>var
>> JpegImage : TJpegImage;
>>begin
>> ...
>> JpegImage := ImgData.ExtractThumbnailJpeg;
>> ImageScrollBox.Graphic := JpegImage;
>> JpegImage.Free;
>> ...
>>end;
>>
>>Do you get any error message?
>>
>>Best regards,
>>
>>Michel
>>
>>>Hello Michel
>>>
>>>This kind of Code I have already tried.
>>>I would like to extract the thumbnail with dEXIF
>>>(<a rel=nofollow target=_blank href="http://mcguirez.homestead.com/downloads.html)">http://mcguirez.homestead.com/downloads.html)</a> and
>>>assign it to the imagescrollbox.
>>>
>>>In dEXIF it uses the library jpeg. I have also
>>>rewritten the function to use TJpegGraphic from
>>>EnJpgGr. It doesn't work, too.
>>>
>>>The Function in dEXIF that extract the Jpeg
>Thumbnail:
>>>function TImgData.ExtractThumbnailJpeg: TJpegImage;
>>>var ti:TJPEGImage;
>>> x:TStringStream;
>>> tb:string;
>>>begin
>>> result := nil;
>>> if HasThumbnail and (ExifObj.ThumbType =
>>>JPEG_COMP_TYPE) then
>>> begin
>>> tb := ExtractThumbnailBuffer();
>>> if (tb = '') then
>>> exit;
>>> x := TStringStream.Create(tb);
>>> ti := TJPEGImage.Create;
>>> x.Seek(0,soFromBeginning);
>>> ti.LoadFromStream(x);
>>> x.Free;
>>> result := ti;
>>> end;
>>>end;
>>>
>>>Have you any other advice.
>>>
>>>Kind Regards
>>>Heinz
>>>
>>>
>>>>
>>>>Hi Heinz,
>>>>
>>>>Try this,
>>>>
>>>>ImageScrollBox.Graphic.Assign(JpegImage);
>>>>ImageScrollBox.Redraw(True);
>>>>
>>>>Best regards,
>>>>
>>>>Michel
>>>>
>>>>>Hello
>>>>>
>>>>>How do I assign a TJpegImage into a ImageScrollBox
>>>>>with Envision 2.0.1. Can you give me an example?
>>>>>
>>>>>Kind Regards
>>>>>Heinz Stampfli

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.