Solved

non-square pictures

Posted on 1998-07-27
5
306 Views
Last Modified: 2010-05-03
How can I put a picture in another format (not a square or a retangle) in the form?
0
Comment
Question by:ruyluis
5 Comments
 
LVL 1

Expert Comment

by:khaledc
ID: 1466883
You posted the question twice, please delete one of them before you create a confusion.
Regards

0
 
LVL 1

Expert Comment

by:Jason_G
ID: 1466884
Hi ruyluis,
do you mean, another picture format such as .bmp, .jpg, etc.  Or do you mean you would like to produce different shapes using the PSet and Line methods?

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
0
 
LVL 4

Accepted Solution

by:
Chizl earned 100 total points
ID: 1466885
Feel privileged, I'm giving you source code out of my own DLL.
This will work for anything with a hWnd.   CommandButtons, Forms, Pictures, ect..

'======================================================
'See
'RoundOffCorners()
'SquareOffCorners()

Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "User32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long

Public Sub RoundOffCorners(ObjectWithHwnd As Variant)
    Dim hr&, dl&
    Dim usew&, useh&
    usew& = ObjectWithHwnd.Width / Screen.TwipsPerPixelX
    useh& = ObjectWithHwnd.Height / Screen.TwipsPerPixelY
    hr& = CreateEllipticRgn(0, 0, usew, useh)
    dl& = SetWindowRgn(ObjectWithHwnd.hwnd, hr, True)
End Sub

Public Sub SquareOffCorners(ObjectWithHwnd As Variant)
    Dim hr&, dl&
    Dim usew&, useh&
    usew& = ObjectWithHwnd.Width * Screen.TwipsPerPixelX
    useh& = ObjectWithHwnd.Height * Screen.TwipsPerPixelX
    hr& = CreateEllipticRgn(0, 0, usew, useh)
    dl& = SetWindowRgn(ObjectWithHwnd.hwnd, hr, True)
End Sub
'======================================================

Chizl
http://www.karland.com/
http://www.sourcesite.simplenet.com/
0
 

Author Comment

by:ruyluis
ID: 1466886
Hi! I'm sorry, but I'm having a lot of troubles at my computer and I'm delaied with you. But I'm accepting now your answer. However, i couldn't use wath you suggested. i would like to know if you accept change e-mail with me to clarify the question. If you accept this, my e-mail is ruyluis@sti.com.br. Thanks
0
 
LVL 4

Expert Comment

by:Chizl
ID: 1466887
chizl@karland.com
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now