Re: Access violation in TJPEGImage on W2K and XP
- From: erewhon@xxxxxxxxxx (J French)
- Date: Fri, 16 Sep 2005 09:47:24 +0000 (UTC)
On 16 Sep 2005 01:20:25 -0700, "jodleren" <sonnich@xxxxxx> wrote:
>The dormat and stuff are new, the original code was:
>
> if (LowerCase(ExtractFileExt(sFilename)) = '.jpg') or
> (LowerCase(ExtractFileExt(sFilename)) = '.jpeg') then
> begin
> { delete old bitmapfile }
> DeleteFile(PChar(WindowsDir + sWinImgFile));
> { converts the image }
> try
> BitmapImage := TBitmap.Create;
> JPEGImage := TJPEGImage.Create;
> if FileExists(sFilename) then
> JPEGImage.LoadFromFile(sFilename)
> else
> JPEGImage.LoadFromFile(WindowsDir + sFilename);
> BitmapImage.Assign(JPEGImage);
> BitmapImage.SaveToFile(WindowsDir + sWinImgFile);
> BitmapImage.Free;
> JPEGImage.Free;
> except
> BitmapImage.Free;
> JPEGImage.Free;
> end;
> end;
>
>
>I agree that the finally should be better, but that is really not the
>problem, nor Dormat or those.
>I have played with this for some time, and by removing the Assign it
>does no longer give the access violation.
>
>The code is so simple, yes, it should work.
>But it does not explain the access violation when closing the app.
>That is my main point.
Most likely there is something else wrong in your App which only shows
up if you do not do the Assign
.
- References:
- Access violation in TJPEGImage on W2K and XP
- From: jodleren
- Re: Access violation in TJPEGImage on W2K and XP
- From: Nicholas Sherlock
- Re: Access violation in TJPEGImage on W2K and XP
- From: jodleren
- Access violation in TJPEGImage on W2K and XP
- Prev by Date: Re: Access violation in TJPEGImage on W2K and XP
- Next by Date: Re: Access violation in TJPEGImage on W2K and XP
- Previous by thread: Re: Access violation in TJPEGImage on W2K and XP
- Next by thread: Re: Access violation in TJPEGImage on W2K and XP
- Index(es):
Relevant Pages
|
|