|
You might try using CreateHatchBrush[^] instead of CreatePatternBrush.
Software Zen: delete this;
|
|
|
|
|
Thanks for replying soon Gary R. Wheeler.
CreateHatchBrush can be used for creating single hatch lines in the diagonal view.But i want to create double hatch lines closely in the diagonal area.Thats why i have created Bitmap using double hatches in the diagonal area and using that.Can u please help in this?....
|
|
|
|
|
The problem you are having is due to the fact that a brush draws in terms of pixels. The printer has a much higher resolution, causing the bitmap hatch on the screen to appear much smaller.
I think the solution is to use a different bitmap for the printer. The printer bitmap should be scaled larger by the ratio of the printer resolution vs. the screen resolution.
I'm guessing here; this is something you will have to play with to achieve acceptable results.
Software Zen: delete this;
|
|
|
|
|
I have added a MFC class with the template selected as MFC ODBC consumer, in my project. The project is using an Access database. But when I insert a record in the database using AddNew() its giving me the error that "Recordset is read only".
Can anybody help me.
aasstt
|
|
|
|
|
How are you opening / creating the recordset?
|
|
|
|
|
i have to develope one pop up window in MFC.. since i'm a beginner in VC++, i find it very difficult to do it.. kindly send me some sample code for this...
Ravi Chandran.C
|
|
|
|
|
|
i need some sample codes to develope sine i'm a beginner
Ravi Chandran.C
|
|
|
|
|
Hi,
How to have bitmap captured from visible+nonvisible area from the scrollview.
I am reposting this because noone answered this previously.
Thanks
cric
|
|
|
|
|
Not sure what you mean by visible+nonvisible area. Do you mean client area + non-client area?
In that case you use CWindowDC instead of CClientDC.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Steve ,
I do not want non client area.
But I want visible + nonvisible area from scrolview
thanks
cric
|
|
|
|
|
Ahh, by nonvisible, you mean, the area that's scrolled out of the current view, I get it now.
I believe the bitmap of scrollview is only the size of the window, so if you're drawing outside of it, it get's clipped.
I think you might have to create a seperate bitmap the size of the total document, select it into a temporary memory dc, and draw the entire document on the new bitmap. Then you can do whatever you need to do to the bitmap.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
steven
how to create bitmap from entire doument? I only know it from view.
thanks,
Cric
|
|
|
|
|
And, this is where it gets complicated. Are you drawing your own document or using a standard control like CEdit?
Maybe it would help if you told us what exactly you are trying to accomplish.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I have scrollview, it will have grid drawn, I draw few graphic objects
in the view. Respective document will store these objects, thir geometry.
( Wish there could be attachment facility with this post )
I have one ddialog wih a picture control in it.
as I scroll view , a bitmap should be captured from whole document with a rectangle showing the scrollview visible area. this bitmap will be displayed on the picture control. or we can use separate view for this purpose which will be a fitted view and will show a rectangle showing scrollviews rectangle.
So every time view is panned the bitmap will get created and it will be displayed in the picture control.
!---------------------
|............................|
|.... ------- ............|<--- nonvisible area
|............................|
||||||||||||||||||||||
|....-------.............. |
|.................... .......|<---- scroll view visible area
||||||||||||||||||||||
|........................... |
|.......------............ |<--- nonvisible area
|__________________|
lines are graphic objects in the view., dotn consider dots they are emplty spaces.
now my bitmap should represent like ..
-----------------------
|..............................|
|..............................|
|........-------............|
|._____________........|
|.|...-------......|.......|
|.|...................|.......|
|.|____________|.......|
|.......------..............|
|__________________|
INternal ractangle in the bitmap is representing the actual current visible
area of the scrolview. This rectangle will always on the different position,
or smaller or bigger depending on zoom, visible area of scrol view.
If the scrolview is fitted it should match the outer rectacngle .
Hope this makes it clear.
Cric
-- modified at 6:35 Saturday 29th April, 2006
|
|
|
|
|
I think that makes sense. Kind of a "preview" control or "where are you" control.
One way to do it would be to just draw your whole document on a temporary memory DC, draw a rectangle on the tempDC indicating the scrollview's current view area, then StretchBlt the temporary DC's bitmap to the preview windows DC.
- S
50 cups of coffee and you know it's on!CDC
|
|
|
|
|
i have created 3 property pages. in these prop. pages i wanna to exchange the data .eg. datat transfer between a edit control on one property page and edit control on another.
can i get help?
jiteen
|
|
|
|
|
Description of class CXmlFile :
+ Data members :
m_tagRoot // Stores root tag (master tag) of the xml file
+ Construction & destruction
CXmlFile //Contructs a CXmlFile objiects
~CXmlFile //Destructs a CXmlFile objiect
+ Operations
LoadTags //Loads the root tag and its child tags in an xml file into memory and store the root tag in m_tagRoot member.
Open //Opens an xml file. This method is also used to creat a new xml file.
close //Closes an xml file.
GetRootTag //Returns pointer point to the root tag.
+ Status
IsReadMode //Returns bool value which specifies whether the xml file is in read mode.
IsWriteMode //Returns bool value which specifies whether the xml file is in write mode.
Thank ! ^_^
My Email : vietsoft2006@yahoo.com
Perseverance for success !
Myhomepage : http://www.bacninh.tk
Welcome my countryside
-- modified at 23:33 Friday 28th April, 2006
|
|
|
|
|
|
Can you explain clearly to me about my problem?
You provide me with code of class CXmlFile, if you can, please.
I need it a lot.
I'm looking forward to hearing from you soon.
Thanks a lot !
perseverance for success !
|
|
|
|
|
Hi everyone,
Please excuse this basic question.
(1) I have created a Setup and Deployment project and one of the dialog
boxes uses a shockwave flash object
(2) I am using Visual Studio .NET 7.1
Problem : The "Movie" property of the ShockWaveFlash object only accepts an
absolute path like "C:\somefile.swf".
I am unable to assign a relative path like "somefile.swf" which picks up the file from the current folder.
Please help on this
|
|
|
|
|
hey does anyone know how to quickly convert a hex value to its corresponding character representation. For example, 4E would convert to F or 50 would convert to P, etc.. etc.. etc.. thanks in advance
|
|
|
|
|
For the below function FkHex2ByteA the resulting byte can be treated (cast) as a char if you know the hex value will map to an ascii character value.
typedef unsigned char byte;
cchar *VkCharHexL = "0123456789abcdef";
byte FkHex2ByteA( char C1, char C2 )
{
C1 = tolower(C1);
C2 = tolower(C2);
cchar *sp1 = strchr(VkCharHexL, C1),
*sp2 = strchr(VkCharHexL, C2);
if( !sp1 || !sp2 ) return(0);
return( ((sp1-VkCharHexL)<<4) + (sp2-VkCharHexL) );
}
void FkByte2HexA( byte B, char &C1, char &C2 )
{
C1 = VkCharHexL[B >> 4];
C2 = VkCharHexL[B & 0x0F];
}
...cmk
Save the whales - collect the whole set
|
|
|
|
|
so it comes together, I suppose I need to dejoin them first. Why add 4 to it and then together? Its insane that this function even works. I don't like that I have to split the value, is that mandatory? I do like that it works to go from hex to dec, which does make dec to ascii easy to do. I could probably do: sprintf(chr,"%s",dec);, right.. close?
thanks
|
|
|
|
|
borono wrote: Why add 4 to it and then together
You don't add 4, you shift left 4 bits.
borono wrote: I don't like that I have to split the value
I gave the code i did to give you a low-level understanding of what is happening.
As others have pointed out in other threads you can also use strtol or sscanf.
I am assuming the hex is in a string e.g. "F012".
As such just loop through the hex string 2 char at a time.
e.g. something like
void HexToStr( cchar *HEX, char *STR )
{
for( ulong i = 0, j = 0; HEX[i] && HEX[i+1]; i+=2, j++ ) {
STR[j] = (char)FkHex2ByteA(HEX[i], HEX[i+1]);
}
}
... of course you would
- add HEX/STR buffer lengths as function param
- do proper error checking
- do more validation that HEX actually contains hex string
- ...
...cmk
Save the whales - collect the whole set
|
|
|
|