Solved

non-square pictures

Posted on 1998-07-27
5
315 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

856 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