Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Bitmap Image

Bitmap Image

Scheduled Pinned Locked Moved ASP.NET
graphicscsharptutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bajrang Singh
    wrote on last edited by
    #1

    Hi, All I want to make a bitmap thats Each pixel has different Color. I defined it size 1024,700 and used three nested Loops 0 to 255 to get unique color and setpixel sets this color to pixel. but my bmp file's pixel still contains duplicate colors,can anyone will guide me. Thanks again, bye int x=0,y=0; int tot = 0; Bitmap Bmp; //Color color=new System.Drawing.Color.; Bmp = new Bitmap(1024, 700,PixelFormat.Format32bppPArgb); int h = 0; for (int i = 0; i <256; i = i + 8) { for (int j = 0; j < 256; j = j += 1) { for (int k = 0; k < 256; k += 1, x++, h++) { if (h > 255) h = 0; Color newColor = Color.FromArgb(255,i, j, k); Bmp.SetPixel(x, y, newColor); if (x == 1023) { x = 0; y++; } if (y >= 699) { try { Bmp.Save("bmp1.bmp", ImageFormat.Png); } catch (Exception ex) { Response.Write(ex.Message); } return; } } }

    Bajrang Singh Using .net 2.0 (VS2005)

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups