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

C / C++ / MFC

 
GeneralSaving with MFC Pin
dinner@628-Oct-02 11:30
dinner@628-Oct-02 11:30 
GeneralRe: Saving with MFC Pin
Christian Graus28-Oct-02 11:34
protectorChristian Graus28-Oct-02 11:34 
GeneralRe: Saving with MFC Pin
valikac28-Oct-02 11:37
valikac28-Oct-02 11:37 
GeneralRe: Saving with MFC Pin
dinner@628-Oct-02 11:59
dinner@628-Oct-02 11:59 
GeneralRe: Saving with MFC Pin
valikac28-Oct-02 12:12
valikac28-Oct-02 12:12 
GeneralRe: Saving with MFC Pin
Christian Graus28-Oct-02 13:25
protectorChristian Graus28-Oct-02 13:25 
GeneralRe: Saving with MFC Pin
ian mariano28-Oct-02 17:38
ian mariano28-Oct-02 17:38 
GeneralCImage -- Can't get it working Pin
nde_plume28-Oct-02 11:26
nde_plume28-Oct-02 11:26 
I want to use CImage to save a dib as a jpg file. However,
whenever I save it produces a black rectangle. Any suggestions?
Here is my code:

CImage img;
int h = 292;
int w = 248;
// Create a dib section
img.Create(w, h, 8);

// Get a DC and draw in it (a red rectangle)
HDC hdc = img.GetDC();
RECT r;
r.top = r.left = 0;
r.bottom = h;
r.right = w;
HBRUSH br = ::CreateSolidBrush(RGB(255,0,0));
::FillRect(hdc, &r, br);

// Release the DC
img.ReleaseDC();

// now save the image
img.Save("c:/temp/testimg.jpg", Gdiplus::ImageFormatJPEG);

I get a black rectangle file with the correct dimensions.
I am sure I am doing something dumb, but any help would be
appreciated.

TIA.

GeneralRe: CImage -- Can't get it working Pin
Christian Graus28-Oct-02 11:31
protectorChristian Graus28-Oct-02 11:31 
GeneralStrange Problem. Pin
Anonymous28-Oct-02 10:25
Anonymous28-Oct-02 10:25 
GeneralRe: Strange Problem. Pin
Maximilien28-Oct-02 10:35
Maximilien28-Oct-02 10:35 
GeneralRe: Strange Problem. Pin
Anonymous28-Oct-02 11:08
Anonymous28-Oct-02 11:08 
GeneralQuestion concerning bitmaps Pin
Steven M Hunt28-Oct-02 10:22
Steven M Hunt28-Oct-02 10:22 
GeneralRe: Question concerning bitmaps Pin
Christian Graus28-Oct-02 10:29
protectorChristian Graus28-Oct-02 10:29 
GeneralMFC/Win32 MicroPhone Mute Pin
Moshe Bergman28-Oct-02 10:01
sussMoshe Bergman28-Oct-02 10:01 
GeneralRe: MFC/Win32 MicroPhone Mute Pin
ian mariano28-Oct-02 17:43
ian mariano28-Oct-02 17:43 
GeneralSending Keyboard Events to a Window Pin
Abin28-Oct-02 9:31
Abin28-Oct-02 9:31 
GeneralRe: Sending Keyboard Events to a Window Pin
Christian Graus28-Oct-02 10:17
protectorChristian Graus28-Oct-02 10:17 
GeneralThank you, and gimme more... Pin
Abin28-Oct-02 15:43
Abin28-Oct-02 15:43 
GeneralRe: Thank you, and gimme more... Pin
Christian Graus28-Oct-02 16:49
protectorChristian Graus28-Oct-02 16:49 
GeneralRe: Thank you, and gimme more... Pin
Abin29-Oct-02 11:07
Abin29-Oct-02 11:07 
GeneralMCI control Pin
devvvy28-Oct-02 9:18
devvvy28-Oct-02 9:18 
GeneralGrid Printing Pin
Anthony988728-Oct-02 9:05
Anthony988728-Oct-02 9:05 
GeneralMFC hinstances Pin
will138328-Oct-02 8:25
will138328-Oct-02 8:25 
GeneralRe: MFC hinstances Pin
Christian Graus28-Oct-02 8:41
protectorChristian Graus28-Oct-02 8:41 

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.