Ok, here is what I am trying to do now.
// TDBImage can't handle JPeg, so need to stream it in to component
if (not (dsManufacturer.FieldByName('Image').IsBlob)) then
dbimgManufacturer.Picture := nil;
JPegStream := TBLOBStream.Create(JPegField, bmRead);
JPegImage := TJPegImage.Create;
From everything I have heard and read, this should work. But when it gets
to the 'JPegStream := ...' line, I get a message 'Invalid class typecast.'.
The cast in the line before works just fine, but the BlobStream doesn't like
it. Any ideas?
>Since I don't see your code that your are staring at I will just make a
>guess. Maybe you are using the blob reading as a bitmap. Maybe you should
>indicate that it will be a JPG before reading the file?
>> I have a form that allows a user to pick an image (usually JPeg) to
>> associate with a particular record. I added the JPeg unit to the uses
>> clause of the unit. It selects and displays the image just fine (using
>> TDBImage.Picture.LoadFromFile). It saves it to the database blob field
>> fine as well. When I try to select the record and have the TDBImage
>> display the image, I get a "Bitmap image is not valid."
>> Anybody give me some help on this? I have been staring at it WAY too