Click here to Skip to main content
15,890,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: FullScrean listbox Pin
Niklas L28-Jun-10 1:36
Niklas L28-Jun-10 1:36 
GeneralRe: FullScrean listbox Pin
aangerma28-Jun-10 1:42
aangerma28-Jun-10 1:42 
GeneralRe: FullScrean listbox Pin
Niklas L28-Jun-10 1:52
Niklas L28-Jun-10 1:52 
GeneralRe: FullScrean listbox Pin
aangerma28-Jun-10 2:08
aangerma28-Jun-10 2:08 
GeneralRe: FullScrean listbox Pin
Niklas L28-Jun-10 2:14
Niklas L28-Jun-10 2:14 
GeneralRe: FullScrean listbox Pin
aangerma28-Jun-10 19:42
aangerma28-Jun-10 19:42 
AnswerRe: FullScrean listbox Pin
Member 419459328-Jun-10 7:03
Member 419459328-Jun-10 7:03 
QuestionDislplaying bitmap image on the screen when raw bitmap data is available in memory? (WIN32) Pin
yeswekey27-Jun-10 21:26
yeswekey27-Jun-10 21:26 
Including the bmp image as resource isn't secure (as anyone can tamper easily).

So, I form the raw bitmap data (excluding headers) at runtime using some obfuscated code. The image is 208 pixels wide and has a height of 97 pixels. It takes 24bits per pixel. I'm very weak in GDI. I got a code to display image from resource and I tried modifying. Unfortunately, it didn't work Frown | :(

I'm MFC free till now and would like to remain so Big Grin | :-D

Plz let me know the right approach.

Here is what I tried:

/* ************* Some Globals:********************* */
	HBITMAP bmpExercising;
	BITMAP bitmap;

/* ************* After Calls to CreateWindow ********************* */
	bmpExercising = CreateCompatibleBitmap(GetDC(myWind), 208, 97);
	GetObject(bmpExercising, sizeof(bitmap), &bitmap);

	bitmap.bmBits = buf;
	bitmap.bmBitsPixel = 24;
	bitmap.bmHeight = 97;
	bitmap.bmWidth = 208;
	bitmap.bmPlanes = 1;

/* Declared variables in WindProc */
HDC hDC, MemDCExercising;
PAINTSTRUCT Ps;

/* ************* in WM_PAINT: ********************* */
case WM_PAINT:
	hDC = BeginPaint(hwnd, &Ps);
	MemDCExercising = CreateCompatibleDC(hDC);
	SelectObject(MemDCExercising, bmpExercising);
	BitBlt(hDC, 10, 10, 208, 97, MemDCExercising, 0, 0, SRCCOPY);
	DeleteDC(MemDCExercising);
	DeleteObject(bmpExercising);
	EndPaint(hwnd, &Ps);
	break;


I want to do it without MFC

I'm using Visual C++ 2005 Professional. Windows XP Professional with SP3.
-
S.V.Kaushik

AnswerRe: Dislplaying bitmap image on the screen when raw bitmap data is available in memory? (WIN32) Pin
Niklas L27-Jun-10 21:41
Niklas L27-Jun-10 21:41 
GeneralRe: Dislplaying bitmap image on the screen when raw bitmap data is available in memory? (WIN32) Pin
yeswekey27-Jun-10 21:57
yeswekey27-Jun-10 21:57 
AnswerRe: Dislplaying bitmap image on the screen when raw bitmap data is available in memory? (WIN32) Pin
KarstenK27-Jun-10 21:49
mveKarstenK27-Jun-10 21:49 
GeneralRe: Dislplaying bitmap image on the screen when raw bitmap data is available in memory? (WIN32) Pin
yeswekey27-Jun-10 23:04
yeswekey27-Jun-10 23:04 
QuestionRound Button Pin
john563227-Jun-10 21:25
john563227-Jun-10 21:25 
AnswerRe: Round Button Pin
Software_Developer27-Jun-10 22:16
Software_Developer27-Jun-10 22:16 
AnswerRe: Round Button Pin
Mohan Ramachandra27-Jun-10 22:27
Mohan Ramachandra27-Jun-10 22:27 
QuestionException Pin
T.RATHA KRISHNAN27-Jun-10 21:20
T.RATHA KRISHNAN27-Jun-10 21:20 
AnswerRe: Exception PinPopular
Niklas L27-Jun-10 21:29
Niklas L27-Jun-10 21:29 
AnswerRe: Exception Pin
Aescleal27-Jun-10 22:01
Aescleal27-Jun-10 22:01 
QuestionStdafx Pin
VeSudha27-Jun-10 20:59
VeSudha27-Jun-10 20:59 
AnswerRe: Stdafx Pin
Niklas L27-Jun-10 21:14
Niklas L27-Jun-10 21:14 
QuestionUsage of IHTMLElement Pin
Pk.j27-Jun-10 18:36
Pk.j27-Jun-10 18:36 
AnswerRe: Usage of IHTMLElement Pin
Stephen Hewitt27-Jun-10 19:09
Stephen Hewitt27-Jun-10 19:09 
AnswerRe: Usage of IHTMLElement Pin
ThatsAlok27-Jun-10 19:14
ThatsAlok27-Jun-10 19:14 
AnswerRe: Usage of IHTMLElement Pin
«_Superman_»27-Jun-10 19:23
professional«_Superman_»27-Jun-10 19:23 
GeneralRe: Usage of IHTMLElement Pin
Pk.j27-Jun-10 21:39
Pk.j27-Jun-10 21:39 

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.