Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Delphi 10 TDBImage


This question is not answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 8 - Last Post: Jan 29, 2016 11:16 PM Last Post By: Krzysztof Szyszka
Johnathan Smith

Posts: 10
Registered: 1/16/16
Delphi 10 TDBImage  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 11, 2016 5:49 AM
How to store PNG files (with transparency) in ancient TDBImage (Delphi 10), which only supports the also ancient BMP format?
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Delphi 10 TDBImage
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 11, 2016 6:02 AM   in response to: Johnathan Smith in response to: Johnathan Smith
Johnathan Smith

Posts: 10
Registered: 1/16/16
Re: Delphi 10 TDBImage  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 16, 2016 1:52 PM   in response to: Robert Triest in response to: Robert Triest
Robert Triest wrote:
Use TJvDBImage.

http://wiki.delphi-jedi.org/wiki/JVCL_Help:TJvDBImage.

Hi, Robert

Thanks for your answer. I'll take a look.
Cesar Romero


Posts: 462
Registered: 3/22/00
Re: Delphi 10 TDBImage  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 12, 2016 11:11 AM   in response to: Johnathan Smith in response to: Johnathan Smith
Johnathan Smith wrote:

How to store PNG files (with transparency) in ancient TDBImage
(Delphi 10), which only supports the also ancient BMP format?

Add Vcl.Imaging.pngimage.pas unit to the uses clause.

[]s

Cesar Romero

Johnathan Smith

Posts: 10
Registered: 1/16/16
Re: Delphi 10 TDBImage  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 16, 2016 1:54 PM   in response to: Cesar Romero in response to: Cesar Romero
Cesar Romero wrote:
Johnathan Smith wrote:

How to store PNG files (with transparency) in ancient TDBImage
(Delphi 10), which only supports the also ancient BMP format?

Add Vcl.Imaging.pngimage.pas unit to the uses clause.

[]s

Cesar Romero


Hi, Cesar

Thanks for answering.

Already tried that. Doesn't work.
Cesar Romero


Posts: 462
Registered: 3/22/00
Re: Delphi 10 TDBImage  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 18, 2016 4:09 AM   in response to: Johnathan Smith in response to: Johnathan Smith
Johnathan Smith wrote:

Already tried that. Doesn't work.

Then you are doing something wrong in there, I use it here and works
just fine.

Regards,

Cesar Romero

Cesar Romero


Posts: 462
Registered: 3/22/00
Re: Delphi 10 TDBImage  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 18, 2016 4:24 AM   in response to: Cesar Romero in response to: Cesar Romero
Cesar Romero wrote:

Then you are doing something wrong in there, I use it here and works
just fine.

Or maybe, is TcxDBImage that is doing that.

[]s

Cesar Romero

Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Delphi 10 TDBImage  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 18, 2016 9:25 AM   in response to: Cesar Romero in response to: Cesar Romero
Cesar Romero wrote:
Cesar Romero wrote:

Then you are doing something wrong in there, I use it here and works
just fine.

Or maybe, is TcxDBImage that is doing that.

[]s

Cesar Romero


It's cxDBImage. DBImage assumes the image is a bitmap. It has no way of
determining otherwise. There is a method of trial and error to try and
determine the underlying format, but the format itself does not include what it is.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
Krzysztof Szyszka

Posts: 78
Registered: 3/4/04
Re: Delphi 10 TDBImage  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 29, 2016 11:16 PM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Jeff Overcash (TeamB) wrote:
Cesar Romero wrote:
Cesar Romero wrote:

Then you are doing something wrong in there, I use it here and works
just fine.

Or maybe, is TcxDBImage that is doing that.

[]s

Cesar Romero


It's cxDBImage. DBImage assumes the image is a bitmap. It has no way of
determining otherwise. There is a method of trial and error to try and
determine the underlying format, but the format itself does not include what it is.

Not exactly. To solve this problem you need to change TGraphicField class,
not TDBImage and there is not a method of trial and error.

P.S.
This problem has been solved a long time ago in X-Files Component package
(http://www.x-files.pl/components/index.html - DB-Aware graphic classes)
You can register and optionally installed as default a new TXGraphicField class.
This allows to use TDBImage with any graphic format stored in BLOB fields
(*.bmp, *.ico, *.gif, *.png, *.jpg and others supported by function GraphicClass).

Function GraphicClass can recognize any registered graphic format and it returns appropriate
TGraphicClass. This allows to mix different graphic formats in the same blob/graphic field.

You can download our Demos and check TXGraphicField in XDBControls.exe example.
Unfortunately, BDE is required. The XDBFields unit was created in Delphi 6 times :-)

--
pozdrowienia
Krzysztof Szyszka, X-Files Software
Developer of X-DBGrid Component
Embarcadero Technology Partner
http://www.x-files.pl/
Join to "Delphi X-DBGrid Component Community"
https://plus.google.com/#communities/100842098152269100547
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02