|
I've been trying to create an BMP file, with information generated by Pixel Font Maker[^]
Now this program generated a file with 128 char arrays, where each array is a charactor in the fontset.
What i would love to be able to do, is convert this file into a bitmap of all those fonts, and for this i'll need a bit of help. Like where to begin, if there are classes i can use that has the 'saving' feature buildin and so forth.
I use MFC and VC++6.
Here is a sample of the output of the letter 'A' from pixel font maker
const unsigned char uc2_0041[] = {<br />
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x0c,0x00,0x12,0x00,0x12,0x00,0x12,0x00,0x3f,0x00,0x21,0x00,0x40,0x80,0xe1,0xc0,0x00,0x00,0x00,0x00}
The programs syntax is explained here[^]
Hoping for some help..
PS: I've totally new to this kind of programming, so please don't assume i know anything specific.. Thanks again.
|
|
|
|
|
I think you can use fwrite to write the color of each pixel.
Search some on the structure of a bitmap.
there are two parts:
- a heading containing some info (don't know which by heart)
- RGB of each pixel (but bakwards written so BGR!!)
that's about it what I remember of it, but maybe it will get you started.
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
hi,
anyone know how to define a script variable in Visual Studio for path setting in Project Properties page?
i can see library path setting like this:
$(PUBLIC_PATH)\debug\userapi.lib
how can i define such $(PUBLIC_PATH) by myself?
any help?
thanks,
jim
|
|
|
|
|
I just defined one last night for wxWindows wxWidgets.
Here's what I did...
1) In Windows XP, right-click My Computer, click Properties.
2) Click the Advanced tab.
3) Click Environment Variables.
4) Add your PUBLIC_PATH variable. (you should see the Visual Studio paths in there)
It didn't take effect right away for me - I'm not sure if just shutting down VS will get it to work, or a reboot is required. I rebooted (I needed food anyways) and it worked fine.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Hi all ,
I have an SDI application in which i have created a dialog box and attached that to frame and on the dialog box I kept few buttons which r owner drawn and all the buttons are members of dialog class and are made as objects of button class,now when ever i click the button on the dialog box keyboard messages should be generated and that character should be sent to the edit view by using the following code they r displaying but giving problem when i keep cursor on them and try to type with keyboard keys
void MyDialog::OnButton65()
{
CTrailView *pView = (CTrailView *)((CMainFrame*)GetParent())->GetActiveView();
BYTE keyState[256]={0};
GetKeyboardState((LPBYTE)&keyState);
short shift=0;
shift =GetKeyState(16);
short caps=GetKeyState(20);
if(caps)//shift)
{
pView->SendMessage(WM_KEYDOWN, 65, 1);///for 'A'
pView->SendMessage(WM_CHAR,65,1);
pView->SendMessage(WM_KEYUP, 65, 1);
}
if(!caps) //!Shift)
{
pView->SendMessage(WM_KEYDOWN, 97, 1);///for 'a'
pView->SendMessage(WM_CHAR,97,1);
pView->SendMessage(WM_KEYUP, 97, 1);
}
}
the reason is my 2nd and 3rd parameters of SendMessage are not correct can any one tell me how can I send proper wparam and lparam values there so that I can proper out put and which API's gives me those values
Request to all to continue this
|
|
|
|
|
Hi,
i am using a listbox with several entries. At runtime I wanna delete an entry without losing the others indizes. The reason is: I am using an array of a structure, and every entry has its own structure. But, if I delete an entry, lets say, at the beginning, all others will change their index. This way I cant use this index as number for the structure array. I tried to do a little workaround with SetItemData, but thats some kinda too complicated.
What can I do? Did I miss anything?
One more thing, which may solve the problem too: How can i change the text of a Listbox item? I used to delete the item and insert it again,but that causes the same problems with indexing as mentioned above!
DKT
|
|
|
|
|
When deleting an item in listbox why don't you delete the corresponding array item (ie, update you array ) also.
There is no spoon.
suhredayan
|
|
|
|
|
Cause, if I delete the corresponding array item, all others will keep their index for the array, not like the listbox. If it would change its index just like the listbox does, there wouldnt be any problem! And I dont think that you can simply change the indizes of a structure array! Correct me if I am wrong.
DKT
|
|
|
|
|
Yes, you have to take the pain of removing the corresponding structure from the array and shift all the below structures up and update the array count variable.
MFC provide collection class to do this for you CArray, CMap etc.
A better solution will be to use CMap and map the structure with the listbox text. But for this to work nicely there should be no repetations in listbox contents.
There is no spoon.
suhredayan
|
|
|
|
|
What excatly do you mean by mapping the structure with the listbox text?
I will work on that CMap class, and hope to find some useful information.
Thanks for pushing me in the right direction, and it would be nice if you could explain me the question above!
EDIT: If I am right, this class will connect an ID with another, chosable, ID. That seems to be like the SetItemData function for listbox entries, is that correct? What is more useful? I am using this function right now, and its eehm, yeah, like a little, not that fine, workaround for the problem...
DKT
|
|
|
|
|
what I do is create each structure on the heap, and store its pointer for the itemdata. I also put the pointers in a vector container. this way, I can cast the itemdata of an item back to a pointer of my type of struct or class, and delete items whenever I need to. The only thing is making sure that you have some type of cleanup routine in the class that's using the vector, to iterate through the collection and call 'delete' on each element.
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
BlackDice wrote:
what I do is create each structure on the heap, and store its pointer for the itemdata.
I concur. This is just the natural way of dealing with listbox data.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
you need to manually synchronize your "internal array" with the listbox.
I would suggest that you change your "internal array" to something else, like a vector or a list ( either plain MFC or STL ); those will "compact" themselves if you remove an element; if you remove element 5, there will not be an empty space between 4 and 6 ( something like that ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
If this is true for vectors, then i will give it a try with vectors!
I hope this will work better.
Thank you.
DKT
|
|
|
|
|
hai,
i am developing a chat application in turbo c.i used bioscom function to set the port settings and to transmit the data,but iam unable to transmit the data.
the prog is :
bioscom(0,settings,com1);
bioscom(1,n,com1);
'n' is the data which i am transmitting.
but the data is not getting displayed in the hyperterminal of another system.
plz guide me regarding this .
plz reply as soon as possible.
from
narasimha varma p
|
|
|
|
|
What are you using to transmit the data?.. serial cable, modems? Have you confirmed that the hardware is configured correctly by opening a hyperterminal session on the transmitting PC and sending test data to the receiving PC using the same settings as you use in your program? You must make sure that the ports and hardware (serial cable or modems) are properly configured first. Then, if your program still does not work, start looking at the code for errors.
Roger
|
|
|
|
|
i am using null modem cable for the transmission of data.through hyper terminal the data is getting transferred and recieved.but not happening through my program any way i am writing my code down to this matter if possible plz help me to solve this problem
my program is as follows:#include<conio.h>
#include<bios.h>
#include<stdio.h>
#include<dos.h>
#define COM1 1
#define SETTINGS (0x80 | 0x02 | 0x00 | 0x00)
void transmit();
void display();
void main()
{
clrscr();
transmit();
}
void transmit()
{
char msg,msg_in;
int status,out,in,count=0,count_in=0,i,extra;
int x,y,n;
x=bioscom(0, SETTINGS, COM1);
bioscom(3,0,COM1);
n=x;
printf("\n the status in binary is:");
while(n!=0)
{
printf("%d",(n%2));
n=n/2;
}
msg=getche();
bioscom(1,msg,COM1);
printf("\n %d",x);
window(10,10,40,11);
/* while (1)
{
if (kbhit())
{
gotoxy(count+1,1);
if ((in = getche()) == 27)//if esc is pressed then exit
break;
if(in==0)
{
in= getch();
continue;
}
if(in==8 && count>0) { count-=2;cprintf(" \b");}
else msg[count]=in;
if(count==70) {in=13; msg[70]=13;}
count++;
if(in==13 )
{
i=0;
display(msg,14);
for(i=0;i
|
|
|
|
|
Hey, been awful busy this week and didn't notice that you replied.
Check your parameter to bioscom. I think COM1 should be defined as 0 and COM2 would be 1. Your library implementation may be different.
You should be passing 3 for the first argument to obtain the status, not 0.
Take a look at this page for a complete discussion on bisocom...
http://www.funducode.com/freec/Hardware/new_hi_c02/Article02.htm[^]
Roger
|
|
|
|
|
Hi all,
I am in embedded vc++. How to draw a line with line caps like Circle end, Arrow end, Diamond end and so on. I am trying to do in an GDI application.Can anyone help me to do.
Warmly
Darwin S.
DARWIN PAUL RAJ
|
|
|
|
|
Hi all,
Still I didn't get any solutions for the problem. can anyone help to find out the solution for this.
DARWIN PAUL RAJ
|
|
|
|
|
Would you please explain it briefly?
A Journey of thousand miles must begin with a single step.
|
|
|
|
|
FYI I've ONLY written 6 programs in my WHOLE life
So this is what is going on.
function is ln(x^2)=.07
Lower x is .5, Upper x is 1
Gotta find the root...here is the program
#include <iostream>
#include <iomanip>
#include <cmath>
void bisection (double, double, double);
double f(double);
int main()
{
double xl=0.;
double xu=0.;
double xr=0.;
cout<<"Enter a lower number and an upper number:"<<endl;
cin>>xl>>xu;
bisection (xl, xu, xr);
return 0;
}
void bisection (double xl, double xu, double xr)
{
int i=0;
double func1=0.;
double func2=0.;
double func3=0.;
func1= f(xl);
func2= f(xu);
xr=(xl+xu)/2.;
if (func1*func2>0.)
{
cout << "Warning: No root exist"<< endl;
}
else
{
for (i=1; i<7; i++)
{
func3= f(xu);
}
if (func1*func3<0.)
{
cout<<"root lies in lower subinterval"<
|
|
|
|
|
(Hi shorty02br, next time please check the "Do not treat <'s as HTML tags" checkbox before submitting your post so that angle brackets show properly.)
Starting from the '98 C++ standard, cout (and most other runtime library identifiers) are into namespace std . Write std::cout instead and things should be fine. If you don't know what namespaces are, I suggest you goggle for some tutorial, the concept is very simple anyway.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Thank You.
I'm so stupid. i KNOW what name space is. The whole using namespace std;....i don't know what i was thinking. Thank you so much.;)
|
|
|
|
|
Hi,
We are using pervsive database.To run our application we have have to map that server and from that location only we can able to run our application.Initially to run our application we have to register all necessary ocx controls.
But the problem is to archive or some other reason they are changing the servers.At that time again we have register our application.
Can't we register ocx controls in common locations i.e independent of servers.
If anybody know please help me..
Thanks
Kumar
|
|
|
|
|