I've run into a bit of a snag, is it just me or can you not assign an image from a resource to TSpeedButton's glyph without a hideous black outline as shown below?
I've assigned it exactly the same way for the TImage component and I'm getting the result needed.
I've been searching for quite a while but no one seems to have this bizarre and annoying problem.
Here's my source code for the form below:
procedure TForm3.Button1Click(Sender: TObject);
var r : tresourcestream; png : tpngimage;
begin
r := tresourcestream.CreateFromID(hinstance,34,'cardimage');
png := tpngimage.Create;
png.LoadFromStream(r);
png.AssignTo(image1.Picture.bitmap);
png.AssignTo(speedbutton1.glyph);
png.Free;
r.Free;
end;
34 is the image of type 'cardimage' that relates to the image being shown in the picture if you haven't guessed already.
X.Assign(Y)
, notY.AssignTo(X)
. IfTX
doesn't know how acquire attributes from aTY
, it will defer toTY
by callingY.AssignTo(X)
automatically. But ifTY
doesn't know how to assign itself to aTX
, it won't defer to the target object. – Cnidoblast