|
have had some kind of medical shutdown, I'm slowly rebooting now.
and yes, my logic powers are still intact.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Luc Pattyn wrote: have had some kind of medical shutdown,
Sorry to hear that.
Hope you don't BSD before booting completes.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Why would the BSD license be a bad thing?
|
|
|
|
|
I would say his question is in the correct place. It isn't about web development, it's about using the WebBrowser control, a Windows control.
only two letters away from being an asset
|
|
|
|
|
Noted.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I guess, Images will be loaded in web browser whenever you mention proper path in img tag. So no need to send images, rather send its path which corresponds to the image.
|
|
|
|
|
Abhishek Sur wrote: Images will be loaded in web browser whenever you mention proper path in img tag
Umm, I'm not trying to load images from the web or from the file system. I'm wanting to feed them from my desktop application into the embedded WebBrowser control. Basically, I'm trying to feed either an image object or a MemoryStream.
Any ideas out there???
|
|
|
|
|
If you are using .NET web browser control, you might use base64 string for the image. say you have an image, you convert it to base64 and embed it directly in the web browser document.
See the example :
<img
src="data:image/gif;base64,R0lGODlhUAAPAKIAAAsLav///88PD9WqsYmApmZmZtZfYmdakyH5BAQUAP8ALAAAAABQAA8AAAPb
WLrc/jDKSVe4OOvNu/9gqARDSRBHegyGMahqO4R0bQcjIQ8E4BMCQc930JluyGRmdAAcdiigMLVr
ApTYWy5FKM1IQe+Mp+L4rphz+qIOBAUYeCY4p2tGrJZeH9y79mZsawFoaIRxF3JyiYxuHiMGb5KT
kpFvZj4ZbYeCiXaOiKBwnxh4fnt9e3ktgZyHhrChinONs3cFAShFF2JhvCZlG5uchYNun5eedRxM
AF15XEFRXgZWWdciuM8GCmdSQ84lLQfY5R14wDB5Lyon4ubwS7jx9NcV9/j5+g4JADs=
" alt="British Blog Directory" width="80" height="15" />
Just read the image from your desktop application to memorystream, convert it to base64 and feed into the img control inside the web browser document.. .
Hope this is what you are looking for...
|
|
|
|
|
Using Base64 is a great suggestion. I'll try that. It should work as I believe that how images are being Marshalled through the COM interface is what is causing the problem. Strings marshal with no problems.
The embedded WebBrowser will not recognize the data scheme unless the user has IE8 installed, but sending the image as a base64 string should allow me to get the job done.
|
|
|
|
|
Yes Right.. Try that.
|
|
|
|
|
Hello,
does anyone know how I can create buttons in the screen preview in C#?
With screen preview I mean the little screen you see when your pointer is on the program in the taskbar. Any idea's? Windows Media Player uses it, so it is possible.
|
|
|
|
|
|
Thank you very much!
|
|
|
|
|
I can't seem to find help on this anywhere, but is there a way to detect the user's preference to show mnemonics? This is an 'Ease of Access Center' setting in vista and 7, and an Display->Appearance 'Effect' in XP.
Maybe WMI? Any help would be appreciated. My component vendor has a on/off toggle to display, but I'd rather have it default to whatever the system setting is.
|
|
|
|
|
It seems that System.Drawing.Font won't recognize built in printer fonts, so the font gets substituted. This is not just a cosmetic problem for me, it's a show stopper. I'm trying to print bar codes using the printer's built in fonts.
Does anybody know a workaround?
[edit]I saw the font class has a static method called FromHfont(). Maybe I can use it with some P/Invoke magic...[/edit]
[edit]Nope. When I create the font from a HFONT, Font.FromHfont() throws a "The font is not a true-type font" exception. I suppose I'll just have to solve this using C++/CLI...[/edit]
--
Kein Mitleid Für Die Mehrheit
modified on Tuesday, October 27, 2009 2:59 PM
|
|
|
|
|
Hi,
First of all I don't know the answer, but I am interested to learn about this.
Do other apps use your printer fonts the way you want it? Did your printer come with fonts you could install on your PC?
Jörgen Sigvardsson wrote: I suppose I'll just have to solve this using C++/CLI...
I don't see how the language would be a factor.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Luc Pattyn wrote: Do other apps use your printer fonts the way you want it? Did your printer come with fonts you could install on your PC?
The fonts are built into the printer. In this particular case, they're barcode fonts. The reason for this is two fold:
1) You don't have to perform checksum calculations yourself - just draw your string with the printer font and you'll get a barcode
2) They don't want to release the fonts because of intellectual properties. You usually have to buy these fonts.
The fonts are locked in the memory of the printer, and cannot be installed on the computer.
Luc Pattyn wrote: I don't see how the language would be a factor.
I feel more comfortable using the Win32 API using C++ than I do C#. Feels more natural I guess. :shrug:
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
These types of printers generally have their own API provided by the maker of the printer. Some offer ActiveX (and if you're lucky .NET) components that are often free, by request, or if they are jerks, they'll charge for it (like Wasp Labelers).
Check w/ the manufacturer of the printer.
|
|
|
|
|
It's a perfectly GDI-capable printer. I've done this before in C++, so I know it's possible. Heck, you can even use Wordpad to print your labels.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Jörgen Sigvardsson wrote: you can even use Wordpad to print your labels
Doesn't that imply the printer fonts are also installed on Windows, and you tell Notepad to chose such font? If so, they must appear in FontCollection.Families with their correct names, and you could use them in yout C# app?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
You tell Wordpad what printer it should use. Then it'll list all the installed fonts, and the fonts available in the printer.
The Winforms stuff only handles True/Open-type fonts. You get a clear indication of that when you create a GDI font object and pass it to Font.FromHfont(). The exception explicitly says "Only true types are supported", meaning that I can never reference printer fonts using System.Drawing.Font. I'm guessing it's a GDI+ limitation, due to the fact that the printer fonts are bitmapped fonts, and not true-type ones.
From what I can tell, the only way to use these fonts is to go the GDI32 way...
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
OK, I think I understand what you are saying. I don't like it much, OTOH what could GDI+ do with a font that only exists in a printer, it can't use it to draw on the screen...
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
GDI manages it by substituting the font with something it can render. You wouldn't expect to draw with it on screen anyhow. Oh well. I'm already doing it the Win32 way as we speak...
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
I have a problem that is very similar to others that I have seen around the web but no exactly the same. I am trying to call a DLL written in unmanaged C++, from an application written in C#. The C# application will need to pass the DLL function two structs, one with input variables and one for the return variables. I have tried some of the similar solutions but still have not been successful. I have some experience with C# but I am very new to calling DLLs. Any help would be greatly appreciated. Here is my code:
C++:
extern "C"
{
typedef struct
{
unsigned int iSignalCount;
double *dSignal;
unsigned int iFilterCount;
double *dFilter;
} My_Function_Input_Type;
typedef struct
{
unsigned int iDftCount;
double *dDft;
double *dFilteredSignal;
} My_Function_Return_Type;
_declspec(dllexport) void FFT_Convolution(My_Function_Input_Type input, My_Function_Return_Type output);
}
modified on Thursday, October 29, 2009 1:43 PM
|
|
|
|
|
Hi,
you need P/Invoke, which isn't very simple. And having array pointers inside structs makes it even harder.
is the C++ code yours, can you (temporarily) modify it?
I assume the input arrays are instantiated and loaded by managed code, and the arrays in the result are created and loaded by native code? please confirm.
show us what you have so far, and give clear symptoms. I'm not going to explain it all, I'll build on what you have.
And how will the result arrays ever get freed? (it would be much easier if they too could start as managed arrays, hence really be part of the input).
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|