How would I ensure a TppDBImage is of graphic type JPEG when a user creates a new TppDBImage? Our database will always be looking for Jpeg so I don't want the user to have to change it from bitmap everytime they create it.
Hook into the TppDesigner.OnCreateComponent event. There you can check the classtype of the new component, typecast it and set the image type to JPEG from Bitmap. Be sure ppJPEG is in your uses clause.
procedure TForm1.ppDesigner1CreateComponent(Sender: TObject; Component: TComponent); begin if Component is TppDBImage then TppDBImage(Component).GraphicType := 'JPEG'; end;
Comments
Hook into the TppDesigner.OnCreateComponent event. There you can check the
classtype of the new component, typecast it and set the image type to JPEG
from Bitmap. Be sure ppJPEG is in your uses clause.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
I am using RB 9.01 Enterprise in Delphi 7.
ppJPEG, ppCtrls;
procedure TForm1.ppDesigner1CreateComponent(Sender: TObject; Component:
TComponent);
begin
if Component is TppDBImage then
TppDBImage(Component).GraphicType := 'JPEG';
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com