Question:You are developing a utility screen for a new client application. The utility screen displays
a thermometer that conveys the current status of processes being carried out by the application. You
need to draw a rectangle on the screen to serve as the background of the thermometer as shown in the
exhibit.
The rectangle must be filled with gradient shading. Which code segment should you choose?
Exhibit: -(VB.NET) 

A Dim rectangle As New Rectangle(10, 10, 450, 25)
Dim rectangleBrush As New LinearGradientBrush(rectangle, Color.AliceBlue,
Color.CornflowerBlue, LinearGradientMode.ForwardDiagonal)
Dim rectanglePen As New Pen(rectangleBrush)
Dim g As Graphics = Me.CreateGraphics()
g.DrawRectangle(rectanglePen, rectangle) 

B Dim rectangle As New Rectangle(10, 10, 450, 25)
Dim rectangleBrush As New LinearGradientBrush(rectangle, Color.AliceBlue,
Color.CornflowerBlue, LinearGradientMode.ForwardDiagonal)
Dim rectanglePen As New Pen(rectangleBrush)
Dim g As Graphics = Me.CreateGraphics()

g.FillRectangle(rectangleBrush, rectangle) 

C Dim rectangle As New RectangleF(10F, 10F, 450F, 25F)
Dim points As Point() = New Point() {New Point(0, 0), New Point(110, 145)}
Dim rectangleBrush As New LinearGradientBrush(rectangle, Color.AliceBlue,
Color.CornflowerBlue, LinearGradientMode.ForwardDiagonal)
Dim rectanglePen As New Pen(rectangleBrush)
Dim g As Graphics = Me.CreateGraphics()
g.DrawPolygon(rectanglePen, points) 

D Dim rectangle As New RectangleF(10F, 10F, 450F, 25F)
Dim rectangleBrush As New SolidBrush(Color.AliceBlue)
Dim rectanglePen As New Pen(rectangleBrush)
Dim g As Graphics = Me.CreateGraphics()
g.DrawRectangle(rectangleBrush, rectangle) 

+ Answer
+ Report
Total Preview: 1162

Copyright © 2024. Powered by Intellect Software Ltd