Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8417799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:09:03+00:00 2026-06-10T02:09:03+00:00

I am trying to draw an explosion. By draw, I mean using the e.graphics

  • 0

I am trying to draw an explosion. By draw, I mean using the e.graphics function as opposed to using a Picturebox(like I did last time).

Now my question is, that how exactly would I go about doing this? In my mind, I’m thinking of using the e.graphics.fillrectangle(x,y,w,h) and well…alterating the location and the colour to create a composite image which resembles an explosion. However, the process seems a bit hit and miss, since I have to experiment to try and do this – is there a way to do this more effectively?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:09:04+00:00Added an answer on June 10, 2026 at 2:09 am

    You might find the FillPolygonPoint method to be more use.

    Imagine all the points of your explosion like this:

    Explosion as Polygon

    Then the code to draw it looks something along the lines of:

    Public Sub FillPolygonPoint(ByVal e As PaintEventArgs)
    
      ' Create solid brush. 
      Dim blueBrush As New SolidBrush(Color.Blue)
    
      ' Create points that define polygon. 
      Dim point1 As New Point(50, 50)
      Dim point2 As New Point(100, 25)
      Dim point3 As New Point(200, 5)
      Dim point4 As New Point(250, 50)
      Dim point5 As New Point(300, 100)
      Dim point6 As New Point(350, 200)
      Dim point7 As New Point(250, 250)
      Dim curvePoints As Point() = {point1, point2, point3, point4, _
        point5, point6, point7}
    
      ' Draw polygon to screen.
      e.Graphics.FillPolygon(blueBrush, curvePoints)
    End Sub
    

    As outlined in the documentation provided by Microsoft.

    An algorithm (in C#) to create the points of a star dynamically might look like this:

    using System;
    using System.Drawing;
    using System.Collections.Generic;
    
    namespace Explosion
    {
        class Program
        {
            static void Main(string[] args)
            {
                foreach (Point point in CreatePointsForStarShape(15, 200, 100))
                {
                    Console.WriteLine(point);
                }
                Console.ReadLine();
            }
    
            public static IEnumerable<Point> CreatePointsForStarShape
                      (int numberOfPoints, int maxRadius, int minRadius)
            {
                List<Point> points = new List<Point>(numberOfPoints);
    
                for (
                     double angle = 0.0;
                     angle < 2* Math.PI;
                     angle += 2 * Math.PI / numberOfPoints
                )
                {
                    // add outer point
                    points.Add(CalculatePoint(angle, maxRadius));
    
                    // add inner point
                    points.Add(CalculatePoint
                        (angle + (Math.PI / numberOfPoints), minRadius));
                }
    
                return points;
            }
    
            public static Point CalculatePoint(double angle, int radius)
            {
                return new Point(
                   (int)(Math.Sin(angle) * radius),
                   (int)(Math.Cos(angle) * radius)
                );
            }
        }
    }
    

    Here’s the output…

    {X=0,Y=200}
    {X=20,Y=97}
    {X=81,Y=182}
    {X=58,Y=80}
    {X=148,Y=133}
    {X=86,Y=50}
    {X=190,Y=61}
    {X=99,Y=10}
    {X=198,Y=-20}
    {X=95,Y=-30}
    {X=173,Y=-99}
    {X=74,Y=-66}
    {X=117,Y=-161}
    {X=40,Y=-91}
    {X=41,Y=-195}
    {X=0,Y=-100}
    {X=-41,Y=-195}
    {X=-40,Y=-91}
    {X=-117,Y=-161}
    {X=-74,Y=-66}
    {X=-173,Y=-99}
    {X=-95,Y=-30}
    {X=-198,Y=-20}
    {X=-99,Y=10}
    {X=-190,Y=61}
    {X=-86,Y=50}
    {X=-148,Y=133}
    {X=-58,Y=80}
    {X=-81,Y=182}
    {X=-20,Y=97}
    {X=0,Y=200}
    {X=20,Y=97}
    

    You will have to translate this to Visual Basic and add some randomization to give it an explosive look. You could transpose (move) and scale the points through matrix multiplication.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to draw a line using the Graphics 2D but then the
I'm trying to draw a line using ctx.lineTo in loop. I have small function
I am trying to draw in a web worker using html5 canvas. The worker
I'm trying to draw an open rectangle using a Polygon: int[] xPoints = {1,1,3,3};
I'm just trying to draw a line with JavaScript. I would like it to
I'm trying to draw shapes that will move around the screen using the LunarLander
I am trying to draw a line using on touch method. I want that
I'm trying to draw a chart using JFreeChart on Java! The data in which
I am trying to draw a figure something like this: I need to have
I'm trying to draw a circle in c using opengl, that's smaller than the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.