Click here to Skip to main content
15,910,411 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CListBox Pin
CPallini27-Mar-09 0:38
mveCPallini27-Mar-09 0:38 
QuestionRe: CListBox Pin
CPallini26-Mar-09 22:35
mveCPallini26-Mar-09 22:35 
GeneralRe: CListBox Pin
Sophiya Chen26-Mar-09 22:26
Sophiya Chen26-Mar-09 22:26 
QuestionUrgent: How to ignore any other input except keyboard in an application [modified] Pin
Rakesh Pahwa26-Mar-09 19:32
Rakesh Pahwa26-Mar-09 19:32 
AnswerRe: Urgent: How to ignore any other input except keyboard in an application Pin
David Crow27-Mar-09 3:20
David Crow27-Mar-09 3:20 
Question[Message Deleted] Pin
Purish Dwivedi26-Mar-09 19:18
Purish Dwivedi26-Mar-09 19:18 
AnswerRe: URGENT ::: detecting language pack Pin
_AnsHUMAN_ 26-Mar-09 19:29
_AnsHUMAN_ 26-Mar-09 19:29 
AnswerRe: URGENT ::: detecting language pack Pin
CPallini26-Mar-09 21:48
mveCPallini26-Mar-09 21:48 
GeneralRe: URGENT ::: detecting language pack Pin
Cedric Moonen26-Mar-09 21:49
Cedric Moonen26-Mar-09 21:49 
General[Message Deleted] Pin
Purish Dwivedi26-Mar-09 22:38
Purish Dwivedi26-Mar-09 22:38 
GeneralRe: URGENT ::: detecting language pack Pin
CPallini26-Mar-09 22:45
mveCPallini26-Mar-09 22:45 
AnswerRe: URGENT ::: detecting language pack Pin
Michael Schubert26-Mar-09 23:45
Michael Schubert26-Mar-09 23:45 
Questionsocket programing in c++ Pin
hunnyyogi26-Mar-09 18:52
hunnyyogi26-Mar-09 18:52 
AnswerRe: socket programing in c++ Pin
_AnsHUMAN_ 26-Mar-09 19:26
_AnsHUMAN_ 26-Mar-09 19:26 
AnswerRe: socket programing in c++ Pin
CPallini26-Mar-09 21:37
mveCPallini26-Mar-09 21:37 
AnswerRe: socket programing in c++ Pin
David Crow27-Mar-09 3:21
David Crow27-Mar-09 3:21 
QuestionCode snippet for Copying a file from one location to another Pin
V K 226-Mar-09 17:42
V K 226-Mar-09 17:42 
AnswerRe: Code snippet for Copying a file from one location to another Pin
_AnsHUMAN_ 26-Mar-09 18:23
_AnsHUMAN_ 26-Mar-09 18:23 
QuestionThe use of the process handle? Pin
breezescut26-Mar-09 17:25
breezescut26-Mar-09 17:25 
AnswerRe: The use of the process handle? Pin
CPallini26-Mar-09 21:32
mveCPallini26-Mar-09 21:32 
Questiondebug model :CAsyncSocket class ,Dubug Assertion Failed! File:sockcore.cpp Line :408 Pin
vernchen26-Mar-09 17:12
vernchen26-Mar-09 17:12 
AnswerRe: debug model :CAsyncSocket class ,Dubug Assertion Failed! File:sockcore.cpp Line :408 Pin
CPallini26-Mar-09 22:08
mveCPallini26-Mar-09 22:08 
QuestionConforming a bitmap image to a particular resolution without resizing artefacts, and storing it as a PNG image in a database Pin
Sternocera26-Mar-09 12:08
Sternocera26-Mar-09 12:08 
AnswerRe: Conforming a bitmap image to a particular resolution without resizing artefacts, and storing it as a PNG image in a database Pin
Stuart Dootson26-Mar-09 12:58
professionalStuart Dootson26-Mar-09 12:58 
Sternocera wrote:
1. Open an image of any of the major image formats (say Windows bitmap, Jpeg and PNG).


CImage[^]

Sternocera wrote:
2. Conform it to a certain resolution. I have a strong preference for doing so without creating any resizing artefacts. I would like the result to be similar to the result you get by resizing an image in Photoshop, rather than the result you get when internet explorer renders and image at a resolution different to that of the image itself (that creates unsettling artefacts).


Bicubic Interpolation[^]

Sternocera wrote:
3. Convert to PNG, and then get a char pointer to a buffer containing the PNG file, so I can serialise the image as a blob in a database for later retrieval.


Again, CImage. Use the Save[^] method to save to an IStream created on an HGLOBAL[^], i.e. an IStream that writes to memory. Use a null HGLOBAL to start with, then use GetHGlobalFromStream[^] to get the HGLOBAL that the stream eventually ended up allocating. Then use GlobalSize[^] to get the amount of memory used by the stream and GlobalLock[^] to access the memory.

Sternocera wrote:
4. Retrieve the image from the database, and re-create the PNG image to be displayed in my MFC application.


Load the blob into an HGLOBAL (allocate a global with the required size, lock it to get a pointer where you can write the blob contents, hten unlock it). Then create an IStream on that HGLOBAL and use CImage::Load[^] to read the IStream into a CImage.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Conforming a bitmap image to a particular resolution without resizing artefacts, and storing it as a PNG image in a database Pin
Sternocera26-Mar-09 13:12
Sternocera26-Mar-09 13:12 

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.