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 » 2016-11-01T18:53:24-07:00

How do I render an Magick++ Image to a Windows device context so that an image appears in a window ?

snibgo
Posts: 12002
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Render Image to Windows device context

Post by snibgo » 2016-11-02T07:55:33-07:00

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 » 2016-11-03T13:27:17-07:00

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