|
-
Jun 15th, 2013, 01:40 PM
#9
Re: API get pixel
 Originally Posted by jmsrickland
Why don't you just use Picture1.Width and Picture1.Height only? Why the other stuff?
Because Picture1.Width and Picture1.Height returns the size of the PictureBox control itself while the dimensions of the PictureBox's Picture property are obtained through the similarly named Width and Height properties of the StdPicture class. The Picture property's dimensions are usually independent from the size of the PictureBox, but in this case, since the AutoSize property was set to True, both dimensions of the PictureBox and its Picture property coincide with each other. However, I decided not to rely on this fact, but instead I used the ScaleX/ScaleY methods of the Form to convert the true dimensions of the Bitmap Picture from HiMetric to Pixels.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|