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. General Programming
  3. C / C++ / MFC
  4. When use Bitmap::Clone(), I meet a problem.(about GDI+)

When use Bitmap::Clone(), I meet a problem.(about GDI+)

Scheduled Pinned Locked Moved C / C++ / MFC
graphicswinformsalgorithmshelptutorial
2 Posts 2 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.
  • S Offline
    S Offline
    samfromcn
    wrote on last edited by
    #1

    Source bitmap is 800*600, and I called Clone(700, 500, 900, 700, PixelFormatDontCare),method failed. After searching in msdn, I know why the call failed. But what I really want is a new bitmap, 200*200, part of it is a copy of the source bitmap, and the other part is white color. How to get such a bitmap? Wish someone give me some ideas.:-O

    J 1 Reply Last reply
    0
    • S samfromcn

      Source bitmap is 800*600, and I called Clone(700, 500, 900, 700, PixelFormatDontCare),method failed. After searching in msdn, I know why the call failed. But what I really want is a new bitmap, 200*200, part of it is a copy of the source bitmap, and the other part is white color. How to get such a bitmap? Wish someone give me some ideas.:-O

      J Offline
      J Offline
      Justin Tay
      wrote on last edited by
      #2

      The steps should be as follows 1) Create a Bitmap of size 200 x 200 2) Create a Graphics FromBitmap 3) Graphics FillRectangle white 4) Graphics DrawImage with appropriate source and destination rectangles

      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