TPicture : Where is wrong ?

Hi to all .
I have 3 TPicture objects and a Canvas .

Pic1 - store a jpeg file
Pic2 - store a jpeg file
and Pic3 - store a black bitmap :
 
Pic3.Bitmap.Canvas.Brush.Color:=clBlack;
Pic3.Bitmap.Canvas.FillRect(RECT(0,0,200,200));

For the case :
   Canvas.Draw(0,0,Pic1.Graphic);
I can see in canvas Pic 1 .

For the case :
   Pic1.Assign(Pic2);
   Canvas.Draw(0,0,Pic1.Graphic);
I can see in canvas Pic 2 .

But for :
   Pic1.Assign(Pic3);
   Canvas.Draw(0,0,Pic1.Graphic);
I can't see anything . In normal case I must see a black square .

Where I wrong ?
LVL 9
ginsonicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kretzschmarCommented:
hi ginsonic,

maybe you must the picture first tell the width and height of the bitmap like

Pic3.Bitmap.Width := 200;
Pic3.Bitmap.Height := 200;
Pic3.Bitmap.Canvas.Brush.Color:=clBlack;
Pic3.Bitmap.Canvas.FillRect(RECT(0,0,200,200));

meikl
0
ProbieCommented:
Yes, it's importent to set the width and height of bitmaps created in runtime.
/Probie
0
ginsonicAuthor Commented:
What stupid I am :P

Kretzschmar  thanks for help .
Put an answer please.
0
kretzschmarCommented:
hi ginsonic,

glad to helped you
good luck again

meikl ;-)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.