I need to display a different image class than supported (TBitmap, TJPEGImage) for instance a JPG, GIF etc in from a blob field stored in DB. I can load these images into a TcxImage component and it displays (.jpg, not gif, tiff), but I can't get it to display in a grid using Edit Properties as Image. My JPEG, BMP, WMF blobs displays fine. Please help
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Sakkie!
A similar question was answered in our Support Center ID: DQ13981 (http://www.devexpress.com/issue=DQ13981). The idea is to store the correspronding graphic class name within an additional database field.
Thanks,
Nicolas.
Hi, I might be in danger here of sounding stupid, but here goes: I have read the issue you refer to before hand, and even though I did try the proposed solution, I could not get it to work. First of all I could not get the event to fire? - when/how is this handler called? Secondly, if I revert to storing the GraphicsClass in the DB, am I not again limited to the built in classes (TBitmap, TJPEGImage, TMetafile, TIcon)? I have since downloaded and installed the GraphicEx library, which allows me to load a lot more images into a TImage (and TcxImage as well) If I'm able to load these images, surely there must be a way to display these images directly in a grid. If its a case of specifying the graphics class, what graphics class do I use for a PNG or TIFF file?
Hi!
To make it fire, the Image column's GraphicClassName property should be unassigned, this is defined by the following code:
…
function TcxCustomImageProperties.GetGraphicClass(AItem: TObject;
ARecordIndex: Integer; APastingFromClipboard: Boolean = False): TGraphicClass;
begin
Result := FGraphicClass;
if Result = nil then
begin
if APastingFromClipboard then
Result := TBitmap;
if Assigned(FOnGetGraphicClass) then //<<<<<<<<<<<
FOnGetGraphicClass(AItem, ARecordIndex, APastingFromClipboard, Result);
end;
end;
Please make sure that your GraphicClassName property is empty. As for the second question, the standard Delphi TGraphicClass does not support the PNG format, so we cannot provide this feature in our Suites directly. But if you use some 3rd-party component in the Delphi system which provides access to the PNG images via the TGraphicClass, then this will force to load the PNG pictures into the Grid. You should add your unit which supports your graphic class to the "Uses" clause and assign this graphic class to a column cell via the OnGetGraphicClass event (at design time, the cxGrid does not allow you to do this).
Thanks,
Nicolas.