Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image lists

Status
Not open for further replies.

aggro

Programmer
Joined
Jun 9, 2000
Messages
4
Location
GB
can anyone give me an example of code used to put an image from an image list on to a form, possibly including the Canvas and Draw bits where you need to specify co-ordinates. I have to put 3 images onto a form, thank you!
 
&nbsp;&nbsp;&nbsp;&nbsp;This is a bit complex for a single answer. Can you be more specific about what you need? <br><br>&nbsp;&nbsp;&nbsp;&nbsp;There are some good books that will help, too. IMHO, try <i>Borland C++ Builder How-To: The Definitive C++ Builer Problem-Solver</i> by John Miano, Tom Cabanski, and Harold Howe. <p>James P. Cottingham<br><a href=mailto: > </a><br><a href= Veneer Co., Inc.</a><br>All opinions are mine alone and do not necessarily reflect those of my employer.
 
Hello aggro,<br><br>In order to draw a bitmap the best choice is put a TImage object inside the form. Then you can use the following code :<br><br><br>ListOfImages-&gt;BkColor=clBtnFace;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// To assure than background color is the same of the form<br>Graphics::TBitmap *image=new Graphics::TBitmap();&nbsp;&nbsp;// Create an TBitmap object.<br>ListOfImages-&gt;GetBitmap ( NumberInList, image);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Get the 'NumerInList' image of the 'ListOfImages'<br>ImageInsideForm-&gt;Picture-&gt;Bitmap=image;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Assign the TBitmap to the TImage object. It is drawn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// automatically<br>delete image;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// delete the temporal object.<br><br>Good luck with your &quot;Jackpot machine&quot; program ;-) <p>Ferran Casarramona<br><a href=mailto: > </a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top