Is there a way to support the Zip or deflate compression method with Tiff images ?
Kind regards
Frederic
I need to show the .tif format but
I've a problem when try to open TestSynGDIPlus.dpr
There is an error showed up : "Cannot find resource file "d:/TestSynGDIPlus.res. Recreated."
Please some advices.
Many Thank's.
]]>Loading is made dynamically, and it is able to find the best available GdiPlu.dll library (e.g. link to the one supplied with Microsoft Office, if it is newer than the one included within XP).
In fact, the program has to check for GDIPlus availability, and use anti-aliaised drawing only if available.
]]>Would it be possible to make SynGDIPlus (if not already) dynamic so it programs without GDI+ (Old ones), would not crash... So program could disable some features dynamically or inform user, to try to install GDI+ (or someting similar)...
I have made dynamic version of some Gdi+ Delphi implementation, but seems that it will not compile in D2010+ so, would like to have some implementation that would work for DD7 and D2010, before we can jump away from the D7.
-Tee-
]]>Thanks for the report and update!
But I'm having an issue trying to get a JPG that is in a stream into a graphic. I'm going to play some more before I whine about something else I didn't read about. {smirk}
Edit: Over thought things at this end. All working as intended. TYVM.
]]>var
/// GDI+ library instance
// - only initialized at program startup if the NOTSYNPICTUREREGISTER is NOT
// defined (which is not the default)
// - Gdip.Exists return FALSE if the GDI+ library is not available in this
// operating system (e.g. on Windows 2000) nor the current executable folder
Gdip: TGDIPlus = nil;
To use pictures in your code, you will need to call once:
Gdip.RegisterPictures; // will initialize the Gdip library if necessary
I'm running Win7 Pro 64-bit, compiling under D7Pro 7.2. I'm trying to use the LoadFromFile routine. Tracing through your code, I get stopped at line 1200:
if not Gdip.Exists or not FileExists(FileName) then
exit;
Tracing through it looks through the function [Exists] returns, but then immediately jumps to the end of the LoadFromFile routine. Doesn't even hit the EXIT command.
So I tried changing the logic of the code, JUST to make sure.
procedure TSynPicture.LoadFromFile(const FileName: string);
var FS: TFileStream;
begin // don't use direct GDI+ file oriented API: it's better having a local
// copy of the untouched data in memory (e.g. for further jpeg saving)
Clear;
if (Gdip.Exists) then
if (FileExists(FileName)) then begin
FS := TFileStream.Create(FileName,fmOpenRead or fmShareDenyNone);
try
LoadFromStream(FS);
finally
FS.Free;
end;
end;
end;
So apparently GDIP actually doesn't exist? It goes again through the function Exists, but then drops right to the end of the function.
What am I doing wrong?
Here is the code I'm using:
procedure TForm1.Button2Click(Sender: TObject);
var
Pic:TSynPicture;
const fname='C:\Users\Stephen\Dropbox\Photos\Grand Am\DSC00824.jpg';
begin
Pic:=TSynPicture.Create;
Pic.LoadFromFile(fname);
Image1.Picture.Graphic:=Pic;
image2.Picture.LoadFromFile(fname);
end;
Image2 does render the image.
]]>After inspecting my project where I am creating the TImage on runtime I found my error and now I can use what I expected:
Image.Picture.LoadFromFile('D:\test.jpg')
and it is working !
Thank you for you help
]]>It is working in a lot of programs, so we need to know what is wrong with your code, or find out if there is any error in our unit.
]]>No error in the process but the image does not render in the container canvas ( a TPanel ). Any other idea ?
]]> Image.Picture.Graphic := TPngImage.Create;
TPngImage(Image.Picture.Graphic).LoadFromResourceName(HInstance,'wizard2');
That is, use directly the Image.Picture.Graphic and not the Image.Picture.Bitmap property.
It will also be faster, since it will draw it directly to the canvas, no via a temporary bitmap.
jpg.LoadFromFile('d:\teste.jpg');
Image.Picture.Bitmap := jpg.Bitmap
After I tried to undefine the NOTSYNPICTUREREGISTER and use
image.Picture.LoadFromFile('d:\teste.jpg')
In both cases, no error given but the image don´t renderize anything on screen.
If I use the original TJPEGImage and use this code, it works
var
jpg.LoadFromFile('d:\teste.jpg');
Image.Picture.Bitmap.Assign(jpg)
Any clues ?
]]>