Click here to Skip to main content
16,006,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMACRO problem.... Pin
Christian Graus27-Dec-01 18:41
protectorChristian Graus27-Dec-01 18:41 
GeneralRe: MACRO problem.... Pin
PJ Arends27-Dec-01 21:29
professionalPJ Arends27-Dec-01 21:29 
GeneralRe: MACRO problem.... Pin
Michael Dunn27-Dec-01 21:44
sitebuilderMichael Dunn27-Dec-01 21:44 
GeneralRe: MACRO problem.... Pin
Christian Graus28-Dec-01 0:30
protectorChristian Graus28-Dec-01 0:30 
GeneralList Box/Control Always having a selected item Pin
me27-Dec-01 17:32
me27-Dec-01 17:32 
GeneralRe: List Box/Control Always having a selected item Pin
James R. Twine28-Dec-01 7:21
James R. Twine28-Dec-01 7:21 
GeneralGraphics related query! Pin
Nish Nishant27-Dec-01 16:42
sitebuilderNish Nishant27-Dec-01 16:42 
GeneralRe: Graphics related query! Pin
Christian Graus27-Dec-01 16:55
protectorChristian Graus27-Dec-01 16:55 
Hiya Nish.

Nish [BusterBoy] wrote:
some DirectX SDK or OpenGL 2d/3d/whatever?

DirectX has DirectDraw, but OpenGL is all 3D AFAIK.

Nish [BusterBoy] wrote:
Read a PNG file

Easiest way is to use GDI+, but there are other ways around it if you need W95 support.

Nish [BusterBoy] wrote:
Apply a circular mask, using the contrast between
the light subject and the dark background to size and position the mask

Apply a rectangular mask similarly, possibly
rotating the subject to be perpendicular to the canvas

Apply a feather to mask

Black fill the background leaving the subject alone


This is all possible using Win32, your first step is to deal with a DIBSection so you have easy access to the bitmap data to start comparing light/darkness, etc. What the hell is a feather ?

You basically want to take a picture of something over a darker background, figure out it's position and draw a circle around it, then a rectangle ( rotating the image so that it's perpendicular ) and do a fill of the darker area ? Do you want to rotate in place, or to a bitmap of approproate size ?

The fill part is as easy as pie - step through the bits and any below a threshold get set to 0. The rest doesn't sound over hard, but it's probably of a jump off the deep end if it's your first ever graphics assignment. There is a class here on CP that loads and saves PNG from memory, and GDI+ does it also. Chris Maunder has a DIBSection class here, I am also writing one I could send you, it's simpler than his though. As for the rest, if you could provide some more details, and LMK if you intend on using GDI+ or not, I'd be happy to mail you some more detailed source code to get you started.


Christian

After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now

GeneralRe: Graphics related query! Pin
Nish Nishant27-Dec-01 18:13
sitebuilderNish Nishant27-Dec-01 18:13 
GeneralRe: Graphics related query! Pin
Christian Graus27-Dec-01 18:38
protectorChristian Graus27-Dec-01 18:38 
GeneralRe: Graphics related query! Pin
Nish Nishant27-Dec-01 18:52
sitebuilderNish Nishant27-Dec-01 18:52 
GeneralRe: Graphics related query! Pin
Christian Graus27-Dec-01 19:22
protectorChristian Graus27-Dec-01 19:22 
GeneralRe: Graphics related query! Pin
Nish Nishant27-Dec-01 20:48
sitebuilderNish Nishant27-Dec-01 20:48 
Generalpseudocode(sp?) help Pin
Steve L.27-Dec-01 16:12
Steve L.27-Dec-01 16:12 
GeneralRe: pseudocode(sp?) help Pin
Nish Nishant27-Dec-01 16:45
sitebuilderNish Nishant27-Dec-01 16:45 
GeneralXML Program Pin
vinuk27-Dec-01 15:40
vinuk27-Dec-01 15:40 
GeneralRe: XML Program Pin
Tim Smith27-Dec-01 15:56
Tim Smith27-Dec-01 15:56 
GeneralRe: XML Program Pin
27-Dec-01 16:18
suss27-Dec-01 16:18 
GeneralRe: XML Program Pin
Michael Dunn27-Dec-01 16:44
sitebuilderMichael Dunn27-Dec-01 16:44 
GeneralRe: XML Program Pin
27-Dec-01 17:04
suss27-Dec-01 17:04 
GeneralRe: XML Program Pin
Nish Nishant27-Dec-01 21:02
sitebuilderNish Nishant27-Dec-01 21:02 
GeneralRe: XML Program Pin
Tim Smith28-Dec-01 2:17
Tim Smith28-Dec-01 2:17 
GeneralRe: XML Program Pin
Nish Nishant28-Dec-01 18:52
sitebuilderNish Nishant28-Dec-01 18:52 
GeneralRe: XML Program Pin
Tim Smith28-Dec-01 2:24
Tim Smith28-Dec-01 2:24 
Generalwriting and retrieving data from a file Pin
hforbess27-Dec-01 11:53
hforbess27-Dec-01 11:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.