Access violation in TJPEGImage on W2K and XP
- From: "jodleren" <sonnich@xxxxxx>
- Date: 15 Sep 2005 23:58:51 -0700
Hi!
The following code gives an access violation - when the programme is
being closed.
I can the file is a JPG file, it is converted into a bitmap.
I create the components locally, but having them globally does not make
any difference.
The Assign is causing the problem, by removing that, I can make it
work. But that looses the fuction.
I also found, using Canvas.Draw, that just setting both height and
witdh (and by that obtaining some memory) I get the error too without
drwaing at all.
I do get: the problem is by setting the Bitmap image, by setting the
size, or assigning something to it.
I must use some memory, which causes problem when the app is being
closed.
try-except in Form.OnDestroy or anywhere else do not catch it.
I added the dotmat, free, relase, but they do not change it.
I asume the TBitmap is a part of windows.... somehow.
Can anyone help?
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.Dormant;
BitmapImage.FreeImage;
BitmapImage.SaveToFile(WindowsDir + sWinImgFile);
BitmapImage.ReleaseHandle;
BitmapImage.Free;
JPEGImage.Free;
except
BitmapImage.Free;
JPEGImage.Free;
end;
end;
.
- Follow-Ups:
- Re: Access violation in TJPEGImage on W2K and XP
- From: Nicholas Sherlock
- Re: Access violation in TJPEGImage on W2K and XP
- Prev by Date: Re: Translate please?
- Next by Date: Re: Access violation in TJPEGImage on W2K and XP
- Previous by thread: Translate please?
- Next by thread: Re: Access violation in TJPEGImage on W2K and XP
- Index(es):
Relevant Pages
|
|