|
Hey! I drew on my desktop! |
Synapse Jumps
Member #3,073
December 2002
|
Alright, so I'm working on drawing with WinAPI (Yes fellas, this topic again ). And so I'm trying to draw to a (what I think is a) bitmap in a dialog. So I do this in my proc (before the switch) if(PlaceLoaded){ // if we have something to draw HDC ToBlit = GetDC((HWND)GetDlgItem(hwnd, IDC_BITMAP_PREV)); //gets the DC from the dialog blit_to_hdc(place_buffer, ToBlit, PlaceCameraX, PlaceCameraY, 0, 0, place_buffer ->w, place_buffer ->h); //^-- put my Allegro bitmap onto the DC I've gotten from the dialog } Anyways, this shows up right (except that the bitmap overflows past the bitmap and I can't clip it even though I've tried clipping the DC, hwnd, and allegro bitmap, anyways this is another subject). So when I close the window, the bitmap shows up on whatever folder/window/desktop that the program was over. I don't want this! It's bad! Any ideas as to why this may be happening? Thanks for the help guys! |
23yrold3yrold
Member #1,134
March 2001
|
I have no time for a proper answer (not sure what the question was; OP very garbled) but maybe that'll offer insight. Or something. Okay, I gotta go ... -- |
Synapse Jumps
Member #3,073
December 2002
|
Hmm, I think you're getting my problem wrong. I don't want to draw the desktop or draw on the desktop. I really like that code though! It looks like some evil virus! Hehe! But anyways, you are right, my code/question was not clear. I've rewritten it. I hope it's more clear. Again, that code is really fun! |
23yrold3yrold
Member #1,134
March 2001
|
Okay, I'm back I get that error sometimes when the system is low on memory (especially in Mozilla Firebird). So you close the program and the window below doesn't repaint? Unless you're doing something really freaky, then your program shouldn't be responsible for that ... -- |
Synapse Jumps
Member #3,073
December 2002
|
Alright, well, it's probably just my shitty ass computer. Well, if you feel like it, will you just download the attatched .zip and see if the program will run on your computer? I have included a .setting file (that's what this editor edits). I have also included the main.cpp which has all of the windows stuff, the rest of the stuff is just part of my game (please excuse the GPF at closing/reloading of a level, it's a bug in the cleanup of the game). Thank you very much for your time! |
dawei chen
Member #3,373
March 2003
|
Have you tried: InvalidateRect(NULL,NULL,TRUE); |
Synapse Jumps
Member #3,073
December 2002
|
I'm sorry for the lateness of this reply, I have not had access to my source until just right now. I tried that before the dialog closed, however, I changed the first NULL to hwnd, because I looked up the function on MSDN and it looks like that was the appropriate thing to do. Oh, yea that didn't work EDIT: 23, lets never fight again. Cuz I love you and need your help |
dawei chen
Member #3,373
March 2003
|
when the first parameter is NULL,it means to redraw all the windows, |
Synapse Jumps
Member #3,073
December 2002
|
No, it does not work. |
|