Click here to Skip to main content
16,011,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNeed help for memory leak Pin
Vincent Ye7-Jul-04 10:21
Vincent Ye7-Jul-04 10:21 
GeneralRe: Need help for memory leak Pin
David Crow7-Jul-04 10:29
David Crow7-Jul-04 10:29 
GeneralRe: Need help for memory leak Pin
Vincent Ye7-Jul-04 10:40
Vincent Ye7-Jul-04 10:40 
GeneralGDI+ to get image information Pin
pnpfriend7-Jul-04 9:59
pnpfriend7-Jul-04 9:59 
Generalgetting HBitmap handle from RBG data Pin
Omar Alvi7-Jul-04 9:50
Omar Alvi7-Jul-04 9:50 
GeneralRe: getting HBitmap handle from RBG data Pin
Antti Keskinen7-Jul-04 10:36
Antti Keskinen7-Jul-04 10:36 
GeneralRe: getting HBitmap handle from RBG data Pin
Omar Alvi7-Jul-04 20:39
Omar Alvi7-Jul-04 20:39 
GeneralRe: getting HBitmap handle from RBG data Pin
Antti Keskinen8-Jul-04 2:14
Antti Keskinen8-Jul-04 2:14 
If this is the case, then you should divide your process into a two-fold part: the first part consists of the encryption/decryption methods. Both of these functions work on plain files only.

An example: you have a non-encrypted bitmap file. You then give this file's name into the encryption function, that uses the algorithm you determine to write a NEW file, that contains encrypted data. Now, you have an encrypted file.

Next you can give this file as an input parameter to the decryption method, that decrypts the file and WRITES the non-encrypted bitmap file to disk again. When the file write is complete, you can give the file name as a parameter to LoadImage that will then load the bitmap image from disk into memory and give you a HBITMAP handle to it. When the loading is complete, you can delete the non-encrypted bitmap file, leaving only the encrypted one to the disk.

Last alternative is to create the bitmap from scratch. Doing it requires you to fill BITMAPV5HEADER, BITMAPINFO structures, then call CreateDIBitmap to create a device-independent bitmap. An alternative way is to use CreateDIBSection, which will create the DIB and give you a pointer to the location of the DIB bits. You can then use the pointer to write the DIB data directly.

There seems to be one example available here on Code Project. See here.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralConfiguration file in outlook Pin
BrockVnm7-Jul-04 9:46
BrockVnm7-Jul-04 9:46 
GeneralRe: Configuration file in outlook Pin
palbano7-Jul-04 10:11
palbano7-Jul-04 10:11 
GeneralRe: Configuration file in outlook Pin
BrockVnm7-Jul-04 10:29
BrockVnm7-Jul-04 10:29 
GeneralRe: Configuration file in outlook Pin
David Crow7-Jul-04 10:26
David Crow7-Jul-04 10:26 
QuestionScrollbars ?? Pin
0v3rloader7-Jul-04 8:53
0v3rloader7-Jul-04 8:53 
AnswerRe: Scrollbars ?? Pin
Edwin Brunner7-Jul-04 9:18
Edwin Brunner7-Jul-04 9:18 
AnswerRe: Scrollbars ?? Pin
Jesper Knudsen7-Jul-04 10:01
Jesper Knudsen7-Jul-04 10:01 
GeneralRe: Scrollbars ?? Pin
0v3rloader7-Jul-04 11:59
0v3rloader7-Jul-04 11:59 
GeneralRe: Scrollbars ?? Pin
Jesper Knudsen7-Jul-04 12:39
Jesper Knudsen7-Jul-04 12:39 
GeneralRe: Scrollbars ?? Pin
0v3rloader7-Jul-04 14:59
0v3rloader7-Jul-04 14:59 
GeneralOk. More Qs on CDynLinkLibrary and apparent leak. Pin
CherezZaboro7-Jul-04 8:18
CherezZaboro7-Jul-04 8:18 
GeneralCheck Boxes Pin
DanYELL7-Jul-04 8:15
DanYELL7-Jul-04 8:15 
GeneralRe: Check Boxes Pin
Ravi Bhavnani7-Jul-04 8:28
professionalRavi Bhavnani7-Jul-04 8:28 
Generalthread (?) question Pin
sandrineV7-Jul-04 7:53
sandrineV7-Jul-04 7:53 
GeneralRe: thread (?) question Pin
palbano7-Jul-04 9:30
palbano7-Jul-04 9:30 
GeneralRe: thread (?) question Pin
sandrineV8-Jul-04 2:55
sandrineV8-Jul-04 2:55 
QuestionMaximaze window ??? Pin
Larsson7-Jul-04 6:41
Larsson7-Jul-04 6: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.