|
-
Nov 24th, 2010, 09:27 AM
#1
Re: [VB6] - stretch an image to usercontrol size
UserControl.Width,Height are always in Twips: 690 in your case. Same as a form's Width,Height are always in Twips.
UserControl.ScaleWidth,ScaleHeight are in usercontrol's ScaleMode: 46 in your case
In post #2 above I tried to explain that to you. A control's Width,Height values are always in the control's container's scalemode. So UserControl1.Width will be in the uc's container's scalemode. UserControl1.Width is not the same as UserControl.Width called from within the uc.
-
Nov 24th, 2010, 03:34 PM
#2
Thread Starter
PowerPoster
Re: [VB6] - stretch an image to usercontrol size
 Originally Posted by LaVolpe
UserControl.Width,Height are always in Twips: 690 in your case. Same as a form's Width,Height are always in Twips.
UserControl.ScaleWidth,ScaleHeight are in usercontrol's ScaleMode: 46 in your case
In post #2 above I tried to explain that to you. A control's Width,Height values are always in the control's container's scalemode. So UserControl1.Width will be in the uc's container's scalemode. UserControl1.Width is not the same as UserControl.Width called from within the uc.
ok. i understand that. but now i still have the same question: why that width(in these case) bug?
-
Nov 27th, 2010, 11:12 AM
#3
Thread Starter
PowerPoster
Re: [VB6] - stretch an image to usercontrol size
......... i'm still blocked
Last edited by joaquim; Nov 27th, 2010 at 11:17 AM.
-
Nov 27th, 2010, 02:50 PM
#4
Thread Starter
PowerPoster
Re: [VB6] - stretch an image to usercontrol size
i'm good hehehehe
i found the solution:
1 - i have 1 picturebox for catch the real image size and works 100% fine;
2 . i use the Extender object for catch the actual usercontrol size and works fine.
Code:
If blnStretch = True Then
StretchBlt UserControl.hDC, 0, 0, Extender.Width, Extender.Height, UserControl.hDC, 0, 0, imgSize.Width, imgSize.Height, vbSrcCopy
UserControl.Picture = UserControl.Image
End If
my little problem is if i reduze the original size(in UC) the image is showed like a double in diferent size. i belive that is something that i forget in that IF. can you advice me more?
-
Nov 28th, 2010, 09:39 AM
#5
Thread Starter
PowerPoster
Re: [VB6] - stretch an image to usercontrol size
ok... heres the code for avoid the double image :
Code:
If blnStretch = True Then
picGraphicsEffects.Width = Extender.Width
picGraphicsEffects.Height = Extender.Height
picGraphicsEffects.Picture = Nothing
StretchBlt picGraphicsEffects.hDC, 0, 0, Extender.Width, Extender.Height, UserControl.hDC, 0, 0, imgSize.Width, imgSize.Height, vbSrcCopy
UserControl.Picture = Nothing
picGraphicsEffects.Picture = picGraphicsEffects.Image
UserControl.Picture = picGraphicsEffects.Image
End If
but when i reduse de image(from original size), i recive 1 bug. in image the half(more or less) image isn't showed. why? is about the stretchblt bug?
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
|