时间:2021-04-16
以下asp画的五星红旗的源码程序代码:
<%
Option Explicit
Class FiveStarredFlag
PRivate Width
Private Height
Private Filler
Private SizeImage
Private FileSize
Private BitMap()
Private Sub Class_Initialize
Height = 200
Width = 300
Filler = (32 - Width Mod 32) Mod 32
SizeImage = (Width + Filler) * Height \ 8
FileSize = SizeImage + 14 + 40 + 8
ReDim BitMap(Width + Filler - 1, Height - 1)
Star Height * 0.25, Height * 0.75, Height * 0.15, 0
Star Width / 3, Height * 0.9, Height * 0.05, 120.9637565320735
Star Width * 0.4, Height * 0.8, Height * 0.05, 98.13010235415598
Star Width * 0.4, Height * 0.65, Height * 0.05, 74.0546040990771
Star Width / 3, Height * 0.55, Height * 0.05, 51.3401917459099
End Sub
Private Sub Class_Terminate
Response.ContentType = "image/bmp"
Response.BinaryWrite FileHeader & InfoHeader & Palette & ImageData
End Sub
Private Sub Star(x, y, r, a)
Dim pi, v, d, i, j, k, m2
pi = 3.1415926535897932
v = r * Sin(pi * 0.1) / Sin(pi * 0.7)
For j = -r To r
For i = -r To r
d = Sqr(i ^ 2 + j ^ 2)
If d < v Then
BitMap(x + i, y + j) = 1
ElseIf d < r Then
If i = 0 Then
If j > 0 Then k = 90 Else k = -90
Else
k = Atn(j / i) * 180 / pi
If i < 0 Then k = k + 180
End If
k = k - a - 18
While k < 0
k = k + 360
Wend
While k >= 360
k = k - 360
Wend
While k >= 72
k = k - 72
Wend
If k > 36 Then k = 72 - k
m2 = d ^ 2 + r ^ 2 - d * r * 2 * Cos(k * pi / 180)
If (m2 + r ^ 2 - d ^ 2) / (Sqr(m2) * r * 2) > Cos(pi * 0.1) Then
BitMap(x + i, y + j) = 1
End If
End If
Next
Next
End Sub
Private Function CWord(I16)
CWord = ChrB(I16 And &HFF) & ChrB(I16 \ 256 And &HFF)
End Function
Private Function CDWord(I32)
CDWord = ChrB(I32 And &HFF) & ChrB(I32 \ 256 And &HFF) & ChrB(I32 \ 65536 And &HFF) & ChrB(I32 \ &HFFFFFF And &HFF)
End Function
'www.knowsky.com
Private Property Get FileHeader
Const FileType = &H4D42
Const Reserved1 = 0
Const Reserved2 = 0
Const OffBits = 62
FileHeader = CWord(FileType) & CDWord(FileSize) & CWord(Reserved1) & CWord(Reserved2) & CDWord(OffBits)
End Property
Private Property Get InfoHeader
Const InfoSize = 40
Const Planes = 1
Const BitCount = 1
Const Compression = 0
Const XPelsPerMeter = 0
Const YPelsPerMeter = 0
Const ClrUsed = 0
Const ClrImportant = 0
InfoHeader = CDWord(InfoSize) & CDWord(Width) & CDWord(Height) & CWord(Planes) & CWord(BitCount) & CDWord(Compression) & CDWord(SizeImage) & CDWord(XPelsPerMeter) & CDWord(YPelsPerMeter) & CDWord(ClrUsed) & CDWord(ClrImportant)
End Property
Private Property Get Palette
Const BackColor = &HFF0000
Const ForeColor = &HFFFF00
Palette = CDWord(BackColor) & CDWord(ForeColor)
End Property
Private Property Get ImageData
Dim i, j
ImageData = ""
For j = 0 To Height - 1
For i = 0 To Width + Filler - 1 Step 8
ImageData = ImageData & ChrB(BitMap(i, j) * 128 or BitMap(i + 1, j) * 64 or BitMap(i + 2, j) * 32 or BitMap(i + 3, j) * 16 or BitMap(i + 4, j) * 8 or BitMap(i + 5, j) * 4 or BitMap(i + 6, j) * 2 or BitMap(i + 7, j))
Next
Next
End Property
End Class
With New FiveStarredFlag
End With
%>
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
CAXA是很重要的画工程图的软件,而画五星红旗又算基础图,也是老师常给大家布置的作业,在这里呢,小编就跟大家分享一下如何用CAXA画五星红旗。软件名称:caxa
今天小编为大家分享flash简单制作飘动的五星红旗方法,主要用到了渐变颜色的设置、波浪线的鼠绘方法以及动画补间的应用,一起来学习吧。 步骤 1、打开软件
微信头像加国旗怎么弄?2019年国庆就要到了,表达爱国情怀的我们,希望能够加上五星红旗的专属头像,怎么领取国庆专属头像领取呢?感兴趣的朋友快来了解一下吧。软件名
16日晚,聚美优品赴美国纽交所上市。当日,聚美优品创始人兼CEO陈欧及其他高管都现身美国纽交所,而纽交所大楼外也髙悬聚美的巨型横幅,五星红旗也高高飘扬在华尔街。
微信小程序五星评分一位同学说要写五星评分.要有半颗星的评分.于是我做了个玩具.有空了做模块化,这代码看不下去了.代码:1.index.wxml2.index.w