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
C

charmingzuo

@charmingzuo
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to get pixel value in BITMAP?
    C charmingzuo

    Thank twing. Why would you define the array data type as unsigned char? But you still present me a heuristic idea. The following method indeed works well. int size= bm.bmHeight*bm.bmWidthBytes; BYTE *px = new BYTE[size]; pBitmap->GetBitmapBits(size,px); Then, the array px stores the pixel value RGB, you can also use loop in +4 to get single R,G or B value, and use forced transform method, int ( px[i]) to get an int type value. Thanks, Ninaming :rose:

    C / C++ / MFC graphics tutorial question

  • How to get pixel value in BITMAP?
    C charmingzuo

    I want to use following method, but it doesn't work. HBITMAP hBitmap; // Here hBitmap is already available; CBitmap *pBitmap; pBitmap->Attach(hBitmap); BITMAP bm; GetObject(hBitmap, sizeof(BITMAP), &bm); I don't know the function of "LVOID bmBits" in BITMAP structure. According to MSDN, "LVOID bmBits" is the pointer to the pixel value area, so I think I can get pixel value (R,G,B) using loop (bm.bmBits)+ +, unfortunately it cann't work. Maybe it is a pointer to the whole structure, including BITMAPFILEHEADER, BITMAPINFO ?? Thanks in advance.:confused: Nianming

    C / C++ / MFC graphics tutorial question
  • Login

  • Don't have an account? Register

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