?
Solved

non-square pictures

Posted on 1998-07-27
5
Medium Priority
?
325 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Suggested Courses
Course of the Month11 days, 23 hours left to enroll

752 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