How to check if a datafield does contain a picture (Bmp) or is empty?

Posted on 2004-11-29
Last Modified: 2010-04-05
When loading my form, I need to adjust the size of the picture to the size of the TdbImage on the form.
But when I try to do that on a empty datafield it gives an errormessage.

So I have to check if the datafield does contain a picture (Bmp) or is currently empty before calling the resize procedure?
How can I do that?

Thanks Stef
Question by:Delphiwizard
    LVL 12

    Accepted Solution

    Hi Stef,
    I am doing this kind of verification before adjust the size:

      if (FormCatalog.DBImageItem.Picture.Width>0) then
        //  adjust the size of the picture ....

    Author Comment

    Thank you Emil.
    LVL 12

    Expert Comment

    You are welcome Stef.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now