[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 153
  • Last Modified:

Graphics question

How can I display a bitmap on top of another bitmap and allow the user to drag and drop the first bitmap around.  I'd also like to attach text to the first bitmap  that would be visible all the time.
0
scott007
Asked:
scott007
1 Solution
 
ZifNabCommented:
Hi scott007,

007?

Maybe you could introduce a Z-order? e.g. Place your bitmaps in an array... array[0..1] ..

array[0] is bitmap one
array[1] is bitmap Two

Now you always know which one is behind the other.....

Regards, Zif.

0
 
scott007Author Commented:
Also, how can I tell which Bitmap is the one selected.  So far, I end up with one bitmap with many pictures on it...not many layered bitmaps.
0
 
d003303Commented:
Yo,
where do you want the text to be ? Ontop of the bitmap, underneath ? Should the text be transparent ?
Because of the Z-order, you could also stick on the Z-order Windows provides with the creation order.

Slash/d003303
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
scott007Author Commented:
The text could be in different places on the bitmap and it should be transparent.  I'm not really sure what you mean by Z-order.  I'll have to look that up somewhere.
0
 
ZifNabCommented:
Z- Order ? Easy :

You've got an X and Y axis;

for 3D you've need an Z-Axis -> Z-ORDER.


0
 
ssiteCommented:
You won't be able to do it with some coding. If you want an easy approach, then just use TImage and TLabel and set them up correctly.

Z-ORDER means who is above who. You can use the BringToFront/SendToBack methods to change the order of those controls.

However, if you want better performance, what you need to do is create a list in memory of records which can tell you the type of object, it's location, color ....
Then, use the paint event to walk through this array and pain the images yourself.
You just need to use standard windows API (GDI) functions.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now