|
|
|
Hi!
When I call FillRect with a brush created from a bitmap, the rect will get filled but the bitmap is tiled, even though the rect and bitmap size are the same (20 X 20). Is there a reason for that? I thought the bitmap would get displayed correctly!
Screenshot at www.edovia.com/pictures/FillRect.png[^]
<br />
RECT rectThumb;<br />
<br />
hBitmap = (HBITMAP)LoadImage(NULL, m_szThumb, IMAGE_BITMAP, 0, 0,<br />
LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);<br />
<br />
bitmapThumb.Detach();<br />
bitmapThumb.Attach( hBitmap );<br />
bitmapThumb.GetBitmap( &bmp );<br />
<br />
rectThumb.top = rectFill.bottom;<br />
rectThumb.bottom = rectThumb.top + bmp.bmHeight;<br />
rectThumb.left = roundf( ( rectClient.Width() - bmp.bmWidth ) / 2 );<br />
rectThumb.right = rectThumb.left + bmp.bmWidth;<br />
<br />
brush.CreatePatternBrush( &bitmapThumb );<br />
memDC.FillRect( &rectThumb, &brush );<br />
brush.DeleteObject();<br />
|
|
|
|
|
Description of CreatePatternBrush says that Windows uses only the first 8 rows and columns of pixels from the bitmap you supplied. If you just need to display an image, why do not use bitmap-drawing functions, like BitBlt ?
|
|
|
|
|
BitBlt did the trick... thanks!
|
|
|
|
|
|
Hi again guys
This ADO is very frastrating as long as i find out one thing and i try to move on
there comes other problems.
This time i have a problem with _bstr_t
i need to give the value of string token to _bstr_t strName
i tryed _bstr_t= token;
but ofcorse i get incompatible error:: error C2440: 'initializing' : cannot convert from 'class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >' to 'class _bstr
Any other way around
Appreciate
|
|
|
|
|
Token seems to be of type std::string, so try this:
<br />
_bstr_t s = token.c_str();<br />
<br />
|
|
|
|
|
YEAH is Working
Thanks men I'm getting so close
Thanks
Thanks
Thanks
|
|
|
|
|
Hi,
I need an SDL window on MFC application with buttons .Please Share any information about this ...
Manjunath S
GESL
Bangalore
|
|
|
|
|
Manjunath S wrote: I need an SDL window...
What's this?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Geez !!! You are on a forum here, it's not a chat
You posted this question 1 hour ago here[^]. You won't have more answers by flooding the forum !
And you won't have any answers if you don't provide VALUABLE informations !
The only thing I can say, is that you cannot use SDL with MFC. If you want to have a gui, take a look at CEGUI, it can work with SDL.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
toxcct wrote: i've just answered you on your previous thread[^]
How many thread has he opened for same question?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Does anyone have a link to a book I can get to help use SendInput effectively?
I asked question and everytime Im left with more questions.
Like how do I get the action coords from my window to the full screen so I can move the mouse to the correct location?
And many other ?'s.
I would like a book that explains how to use that, block input, mouse events, ect.
Anyone have a link?
1 line of code equals many bugs. So don't write any!
|
|
|
|
|
Dear all,
I have developped an application (being IE) using the microsoft web browser activex control. While accessing some websites i got errors "an error has occurred in the script on this page object expected".
Someone told me I need to Disable Script Debugging within my application (IE). How do i do that programatically ?
Thank you
llp00na
|
|
|
|
|
llp00na wrote: Someone told me I need to Disable Script Debugging within my application (IE). How do i do that programatically ?
Check out:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AdvancedOptions\BROWSE\SCRIPT_DEBUGGER_IE
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
The problem has been solved, "it seems there exists a possibility to keep the web browser control from displaying dialog boxes - via property Silent." as suggested by someone else.
Thanx for helping me out
llp00na
|
|
|
|
|
Hi all again
I have edit box, where I display long texts(file paths).
Problem is that I want the user to be able to see the last part of the text displayed in the Edit Box(it is a file name).
How can I do this ?
thank you.
|
|
|
|
|
|
Have a look at the PathCompactPath() and PathCompactPathEx() API functions.
They can convert a long path string like:
C:\path1\path2\sample.txt
to
C:\pat...\sample.txt
so that it fits within your display window.
I Dream of Absolute Zero
|
|
|
|
|
Hi,
I need to know How to Display a SDL Window in MFC Dialog.
It will be helpful to me if any posted some reference code links or some documents related to this .
Thanks in advance
Manjunath S
GESL
Bangalore
|
|
|
|
|
|
SDL means Simple directmedia layer ..
Its a library for multimedia ,with platform indepedent..
Manjunath S
GESL
Bangalore
|
|
|
|
|
I don't think this is feasible (or at least not easily at all). What are you trying to do exactly ? I think this not the right way to handle it.
Cédric Moonen
Software developer
Charting control
|
|
|
|