473,414 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Why I don't get a smiling face with this code.

Dim strSize As Integer
'Play the chimes sound.
My.Computer.Audio.Play(My.Resources.chimes, AudioPlayMode.WaitToComplete)
'Draw a face
Dim intSize As Integer = Convert.ToInt32(strSize)
If intSize = 0 Then
intSize = 40
End If
If intSize < 28 Then
intSize = 28
End If
If intSize > 45 Then
intSize = 45
End If
DrawIt(intSize)

End Sub
Function DrawIt(ByVal depth)
Dim objBitmap As Bitmap = New Bitmap(50, 50)
Dim g As Graphics = Graphics.FromImage(objBitmap)
Dim objBrush As SolidBrush = New SolidBrush(Color.White)
Dim objBlackBrush As SolidBrush = New SolidBrush(Color.Black)
Dim objYellowBrush As SolidBrush = New SolidBrush(Color.Yellow)

g.FillRectangle(New SolidBrush(Color.White), 0, 0, 50, 50)
'Face
g.FillEllipse(Brushes.Yellow, 0, 0, 50, 50)
'Eyes
g.FillEllipse(Brushes.Black, 10, 15, 10, 10)
g.FillEllipse(Brushes.Black, 30, 15, 10, 10)
'Smile
Dim aPoints(3) As Point
aPoints(0).X = 8 : aPoints(0).Y = 32
aPoints(1).X = 20 : aPoints(1).Y = depth
aPoints(2).X = 30 : aPoints(2).Y = depth
aPoints(3).X = 42 : aPoints(3).Y = 32
g.DrawCurve(Pens.Black, aPoints)
End Function

Any help would be appreciated
Dec 6 '07 #1
1 835
Plater
7,872 Expert 4TB
Do you do anything with that bitmap that you created?
All you do is draw on it and end the function.
You would need to show it somewhere.
Dec 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Jukka K. Korpela | last post by:
No, I'm not making this up, this is what http://www.w3.org/ says when accessed with a text browser, or in any decent browser in no-images mode: "Tim Berners-Lee smiling 2003-12-31: Buckingham...
20
by: B Wooster | last post by:
There is a page that shows Firefox 1.0 render text differently for CSS as compared to FONT FACE for one particular font: http://www.aczoom.com/fonts/xdvng.ttf is the font that does not work. ...
2
by: bine | last post by:
Sorry, I wanted to post a followup to my own question, but google was "Unable to retrieve message 003lv0h2n87mc764odt16i56btesds6dm9@4ax.com" ... I found a solution for printf directly, without...
4
by: cazconv2007 | last post by:
Hi i have a homework on drawing a smiley face then pressing a button to draw a sad face i have some code but nothing works i keep getting an error on my action performed method. can you please look...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.