I need to select a bitmap image in a descendant of TGraphicControl to be displayed at design-time. TImage does this, but I don't want to use TImage (variety of reasons). I have Published the TBitmap as foolows:
type
MyGraphicControl = class(TGraphicControl)
private
FBaseBitmap: TBitmap;
...
protected
procedure SetBaseBitmap(ABitmap: TBitmap);
...
published
property BaseBitmap: TBitmap read FBaseBitmap write SetBaseBitmap;
...
end;
implementation
...
procedure MyGraphicControl.SetBaseBitmap(ABitmap: TBitmap);
begin
????????
end;
Problem is that whatever I seem to try at ?????? I get an access violation error when I select a .bmp file in the Object Inspector at design-time (using the standard graphic property editor).
Also, how do I get the bitmap displayed at design-time? Is it as simple as using
Canvas.Draw(0,0,FBaseBitmap);
in SetBaseBitmap?
Any suggestions (not too rude) would be much appreciated.
type
MyGraphicControl = class(TGraphicControl)
private
FBaseBitmap: TBitmap;
...
protected
procedure SetBaseBitmap(ABitmap: TBitmap);
...
published
property BaseBitmap: TBitmap read FBaseBitmap write SetBaseBitmap;
...
end;
implementation
...
procedure MyGraphicControl.SetBaseBitmap(ABitmap: TBitmap);
begin
????????
end;
Problem is that whatever I seem to try at ?????? I get an access violation error when I select a .bmp file in the Object Inspector at design-time (using the standard graphic property editor).
Also, how do I get the bitmap displayed at design-time? Is it as simple as using
Canvas.Draw(0,0,FBaseBitmap);
in SetBaseBitmap?
Any suggestions (not too rude) would be much appreciated.