VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This sample code draws a circle full of colours on the form and then saves it to a BMP file.

by Shayne Cairns (5 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 24th February 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This sample code draws a circle full of colours on the form and then saves it to a BMP file.

Rate This sample code draws a circle full of colours on the form and then saves it to a BMP file.



      ScaleMode = vbPixels   ' Set scale to pixels.
   AutoRedraw = True ' Turn on AutoRedraw.
   Width = Height   ' Change width to match height.
   CX = ScaleWidth / 2   ' Set X position.
   CY = ScaleHeight / 2   ' Set Y position.
   Limit = CX   ' Limit size of circles.
   For Radius = 0 To Limit   ' Set radius.
      Circle (CX, CY), Radius, RGB(Rnd * 255, Rnd * 255, Rnd * 255)
      DoEvents   ' Yield for other processing.
   Next Radius
   Msg = "Choose OK to save the graphics from this form "
   Msg = Msg & "to a bitmap file."
   MsgBox Msg
   SavePicture Image, "TEST.BMP"   ' Save picture to file.

Download this snippet    Add to My Saved Code

This sample code draws a circle full of colours on the form and then saves it to a BMP file. Comments

No comments have been posted about This sample code draws a circle full of colours on the form and then saves it to a BMP file.. Why not be the first to post a comment about This sample code draws a circle full of colours on the form and then saves it to a BMP file..

Post your comment

Subject:
Message:
0/1000 characters