Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 6, 1997



Application Security Testing: An Integral Part of DevOps

Support The Full ImageList API In VB4

To draw a selected transparent image in VB4 from an Imagelist control, as you do in C++, follow these steps. The ImageList_ API functions have many features that weren't passed through in the control. In order to support the full API, the ImageList control exposes the property hImageList, which returns a handle you can use when calling the API functions. In the ListImage.Draw method, you can specify imlNormal, imlTransparent, imlSelected, or imlFocus. In the underlying API ImageList_Draw function, however, these are bit flags, and there is an additional flag to draw a mask. This function draws an image from an image list with any combination of draw flags:
 Sub DrawImage(img As ImageList, vIndex As Variant, _
	hDC As Long, x As Long, y As Long, _
	Optional vDraw As Variant)

	If IsMissing(vDraw) Then _

	ImageList_Draw img.hImageList, _
		img.ListImages(vIndex).Index - 1, hDC, _
		x / Screen.TwipsPerPixelX, _
		y / Screen.TwipsPerPixelY, vDraw
End Sub
These functions are documented on the MSDN. Take a look. You may find many other uses for them.
A. Nicklas
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date