GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 20-Jul-2007, 04:23
br.ramanand br.ramanand is offline
New Member
 
Join Date: Jul 2007
Posts: 2
br.ramanand is on a distinguished road

Clearing a Picture Control


Hi,

I am on an MFC project in VC++ wherein am using some Picture Controls on the dialog. I load bitmaps onto the picture control using "StretchBlt" function.

I require to clear the loaded image at some point of time fromt he picture control. How do I do it?

Can someone help me with this?. Thank you in advance.
  #2  
Old 22-Jul-2007, 18:41
TurboPT's Avatar
TurboPT TurboPT is offline
Regular Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 966
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Clearing a Picture Control


Try:
CPP / C++ / C Code:
 yourControl.SetBitmap( NULL ); // or ->, if necessary.
I ran this on a picture control as the default CStatic type, made this call through a button-click, and it worked for me.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #3  
Old 22-Jul-2007, 20:37
br.ramanand br.ramanand is offline
New Member
 
Join Date: Jul 2007
Posts: 2
br.ramanand is on a distinguished road

Re: Clearing a Picture Control


Thank you for you kind reply.

I tried the SetBitmap(). But let me tell you the problem.

Currently I draw the image into the control using StretchBlt(). I thought I could clear the control if I mention NULL instead fof the filename in the LoadImage() and then StretchBlt(). Loading works fine, but clearing does not happen.

Secondly, SetBitmap() loads and clears the image properly. But I've problem in this too.
1. When I load the image, the image is not scaled to the size of the picture control and instead, only the part of it that fits into the control is displayed, unlike StretchBlt which fits the whole image into the control

2. When I clear the image, even the border of the control is cleared, thus leaving a blank space on the dialog which looks very odd.

Will you be kind enough to help me out with either clearing the image using StretchBlt() or SetBitmap() that retains the border of the control and just clears the image alone.

Awaiting your reply. Thank you in advance for your reply.
 
 

Recent GIDBlogWriting a book by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with a console menu system BullBuchanan C++ Forum 6 20-Aug-2006 14:46
ActiveX control inside ActiveX control ? sirnowy MS Visual C++ / MFC Forum 1 13-Jul-2006 02:31
[winapi] edit control is lying to me... ubergeek C Programming Language 8 15-May-2005 18:02
Help! Some basal questions about MFC xutingnjupt MS Visual C++ / MFC Forum 1 05-Dec-2004 03:38
Detecting a mouse click outside of control arran.s MS Visual C++ / MFC Forum 1 27-Oct-2004 06:01

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:19.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.