Render Image to Windows device context

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
eldiener
Posts: 10
Joined: 2012-03-29T08:15:10-07:00
Authentication code: 8675308

Render Image to Windows device context

Post by eldiener »

How do I render an Magick++ Image to a Windows device context so that an image appears in a window ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Render Image to Windows device context

Post by snibgo »

You need to call a bunch of Windows functions, which are outside the scope of this forum. In a nutshell: CreateCompatibleDC() and CreateCompatibleBitmap(), then looping through y and x SetPixel(), then finally BitBlt().
snibgo's IM pages: im.snibgo.com
eldiener
Posts: 10
Joined: 2012-03-29T08:15:10-07:00
Authentication code: 8675308

Re: Render Image to Windows device context

Post by eldiener »

I did find how to do it from the IMDisplay and NTMagick example code. It would be nice if the Magick++ API added the techniques found in those examples to its API as a member function of the Image class specific Windows programming.
Post Reply