|
we are using constant constantAlphaImage we are able to draw but without transparency.
imagingImage allow us to apply transparency to png but dont allow to draw.
We are looking to do this effect on the screenshot [url=http://postimg.org/image/bl2e8iy2v/full/][img]http://s7.postimg.org/hm035lkp7/overlaping.png[/img][/url]
Where 1 lap overlap the other chaning the color.
|
|
|
|
|
OK, so what's the question?
|
|
|
|
|
Given the limits of the Compact FrameWork drawing library which include use of transparency for only one color [^], and the fact that people generally have trouble with using the Alpha channel:
"Unfortunately, the NETCF bitmap loader creates a bitmap with the same pixel format as the display when loading a bitmap file or resource and loses the alpha channel information (if present)." [^].
The MSDN blog linked to above may be your best starting point, and it does have usable code.
Looks like you are in for some hairy use of P/Invoke. Note that I don't have a Win Phone and have never programmed to CF.
«I'm asked why doesn't C# implement feature X all the time. The answer's always the same: because no one ever designed, specified, implemented, tested, documented, shipped that feature. All six of those things are necessary to make a feature happen. They all cost huge amounts of time, effort and money.» Eric Lippert, Microsoft, 2009
modified 1-Feb-15 6:38am.
|
|
|
|
|
we try this, but we cant draw polygon with imagingimage,we can only alpha blending files png.
|
|
|
|
|
How can use these WinApi function in c#
Hello i want use a dll file in C#;
this dll file have made in C++ Language.
I want use two function in this Dll file.
This dll file definition c# file is like here:
Code:
using System;
using System.Runtime.InteropServices;
public static class Lcad
{
public const int LC_FALSE = 0;
public const int LC_TRUE = 1;
public const int LC_LBUTTON = 1;
........
.........
[DllImport("litecad.dll", EntryPoint="lcDrwLoadMem", CharSet = CharSet.Unicode, ExactSpelling = true)]
public static extern bool DrwLoadMem(int hDrw, int hMem, int hLcWnd);
[DllImport("litecad.dll", EntryPoint="lcDrwSaveMem", CharSet = CharSet.Unicode, ExactSpelling = true)]
public static extern int DrwSaveMem(int hDrw,int hMem, int MemSize);
}
I want use lcDrwLoadMem and LcDrwSaveMem in my appliation.
I want give some information from dll help file:
These two function definitons:
int lcDrwSaveMem (
HANDLE hDrw,
HANDLE hMem,
int MemSize
);
Parameters
hDrw
Handle to a drawing object.
hMem
Pointer to a memory buffer. If this value is NULL, then LiteCAD will not write to a memory, but, calculates the drawing's size only.
MemSize
Size of the memory buffer, in bytes. This will be ignored if the hMem argument is NULL.
Return Value
Number of bytes copied to a memory. If the return value is zero - an error occurred during this operation. This can happen if the memory buffer size is too small to contain the drawing.
If hMem parameter is NULL, then the return value is a number of bytes required to contain the drawing.
Remarks
Your application must allocate a memory buffer of sufficient size to store the drawing. To determine the drawing's equivalent buffer size, use this function with the hMem=NULL parameter.
And other function:
--------
Loads a drawing's data from a memory buffer. The data must has LCD format.
BOOL lcDrwLoadMem (
HANDLE hDrw,
HANDLE hMem,
HANDLE hLcWnd
);
Parameters
hDrw
Handle to a drawing object.
hMem
Pointer to a memory buffer containing a drawing in LCD format.
hLcWnd
Handle to a design window. Specify NULL if you do not want to display the drawing.
Return Value
If the function succeeds, the return value is nonzero (TRUE).
And I want give an Example from help file:
Code sample LiteCAD API
Save and load a drawing using memory buffer
Code:
// global memory buffer
BYTE* gpMem = NULL;
// Save a drawing into memory buffer
//-----------------------------------------------
BOOL SaveToMem (HANDLE hLcDrw)
{
int MemSize;
if (gpMem != NULL){
// the buffer is not empty, clear it
delete[] gpMem;
gpMem = NULL;
}
// get size required for memory buffer
MemSize = lcDrwSaveMem( hLcDrw, 0, 0 );
if (MemSize > 0){
// allocate memory buffer
gpMem = new BYTE[MemSize];
// write a drawing database into the memory buffer
lcDrwSaveMem( hLcDrw, (HANDLE)gpMem, MemSize );
return TRUE;
}
return FALSE;
}
// Load a drawing from memory buffer
// If you don't need to display the loaded drawing, then specify 0 for hLcWnd
//-----------------------------------------------
BOOL LoadFromMem (HANDLE hLcDrw, HANDLE hLcWnd, BOOL bClearMem)
{
BOOL bRet = FALSE;
if (gpMem != NULL){
bRet = lcDrwLoadMem( hLcDrw, (HANDLE)gpMem, hLcWnd );
// clear memory buffer (if don't needed any more)
if (bClearMem == TRUE){
delete[] gpMem;
gpMem = NULL;
}
}
return bRet;
}
Can anybody convert this example to c# code.Please help me.
|
|
|
|
|
Hi,
I have configured the tessnet2 in c# for my project and it is reading complete sentence when
there is no space in sentence.If any gap or space found in the sentence it will not continues. This
means it is reading only one word.
Please help.
Deatails :
If my image having the data : ABCDEFGH
Result : result from tessnet2 ABCDEFGH
if my image having the data : ABCD EFGH (space between the words)
Result : result from tessnet 2 ABCD
please help and how to solve this issue.
Regards,
Praveen
|
|
|
|
|
We can't answer that - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
We have no idea what your code looks like, how you "configured the tessnet2 in c# for my project", or anything else that might be relevant.
Please, edit your question and provide better information.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
if (Convert.ToInt32(Request.QueryString["update"]) == 1)
{
// go postback
}
}
if (!Page.IsPostBack)
{
UserAccordion12.Visible = false;
PRINT.Visible = false;
SAVE.Visible = false;
Image22.Visible = false;
lblMessage.Visible = false;
DataList4.Visible = false;}
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So apart from mismatched brackets, that doesn't make much sense.
Please, try to explain in better detail!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Really? Come on. If you need to call a block of code from multiple places you put that block of code in its own method. You can then call it from anywhere else you need to.
|
|
|
|
|
hi
How to enable kiosk mode on windows 7 ?
I need to a sample that when windows be load Disable below things
Task Manager
Driver
Task Bar
Combine Keys for example (Alt + Tab , Alt + F4 and ....)
please help me for solve it
it's urgent
thanks
|
|
|
|
|
Off-topic!
Anyways, from this Microsoft answers thread[^], I found this helfull qoute.
Quote: You will need at least a minimum Windows 7 Professional to disable some elements of the Windows interface and security controls such as Ctrl-Alt-Del.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
thanks Afzaal Ahmad Zeeshan for your answer
i saw it , and it close them from register on windows
but i want when windows be load my application Disable them(taskmanager,taskbar,desktop icon)
please help me for resolve it
thanks
|
|
|
|
|
vahidbakhtiary wrote: it's urgent
Nope, I checked with everybody here, and it isn't on anybodies "ToDo" list.
It may be urgent to you, but it isn't to us. All that you stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I have a method that polls different containers of items that are varying in length.
I'd like to divide the container item total count by pages with 1000 items per page, create a new list for each 1000 item page and then spawn a new thread for each page to process the 1000 items asynchronously.
I'm not sure how to create a dynamically named list though? Thanks
|
|
|
|
|
I think to assist you with this we'd need to know some specifics about what "containers of items" are, and what type/structure/format data the results of the "polling" returns.
«I'm asked why doesn't C# implement feature X all the time. The answer's always the same: because no one ever designed, specified, implemented, tested, documented, shipped that feature. All six of those things are necessary to make a feature happen. They all cost huge amounts of time, effort and money.» Eric Lippert, Microsoft, 2009
|
|
|
|
|
Hi,
They are active directory computer objects.
I've typed them into strings from DirectoryServices.SearchResult to an all encompassing list<string> and I'd like to divide them up from that point.
|
|
|
|
|
What is stopping you at this point from creating a List<List<string>> with any arbitrary name and using that ?
private List<List<string>> bunchOData = new List<List<string>>();
private const int ChunkSize = 1000;
private void MakeData()
{
List<string> bigData = new List<string>();
for (int i = 0; i < 23678; i++) bigData.Add("x");
int limit = (bigData.Count / ChunkSize) * ChunkSize;
int finalChunk = bigData.Count - limit;
for (int i = 0; i < limit; i += ChunkSize)
{
bunchOData.Add(bigData.GetRange(i, ChunkSize));
}
bunchOData.Add(bigData.GetRange(limit, finalGulp));
} While GetRange makes a shallow copy (references), the fact you are dealing with strings here makes me wonder about memory usage, particularly when you pass the List<string> items in 'bunchOData into separate threads. If you active-directory-whatever objects turned-into-strings are of varying lengths, then I don't think there's much you can do to avoid getting lots of string being created.
«I'm asked why doesn't C# implement feature X all the time. The answer's always the same: because no one ever designed, specified, implemented, tested, documented, shipped that feature. All six of those things are necessary to make a feature happen. They all cost huge amounts of time, effort and money.» Eric Lippert, Microsoft, 2009
|
|
|
|
|
I did not know you could do that, although I had always wondered how you could fit an array into an array. Thank you for that example, that worked well.
After that bunchOData is populated, I'm trying to start a thread utilizing each 1000 page chunk of data, how can I pass the 1000 page chunk into a new thread? There will be multiple threads going with each 1000 page chunk with my loop and I'd like each thread to return a sorted list<string> itself. Can I pass an unfiltered list to the thread and return a filtered list when the thread is done?
foreach (List<string> data in bunchOData )
{
var t = new Thread(() => searcher(computerNameArray, sidToSearchFor));
t.IsBackground = true;
t.Start();
}
private List<string> searcher(List<string> computerNames, string sidToSearchFor)
{
List<string> returnValue = null;
//do stuff here
return returnValue;
}
modified 2-Feb-15 10:39am.
|
|
|
|
|
Why would you want to name them at all? Just dynamically create the list as usual, and pass it as a parameter to the thread.
The tread constructor has an overload taking a ParameterizedThreadStart - MSDN[^] - allowing you to pass a single parameter as an object to the thread. Pass the newly created List, and cast it back in the thread.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I believe I'm trying to do this very thing but having trouble passing an unfiltered list to the parameterized thread start function and then returning a filtered list from that parameterized thread start.
foreach (List<string> computerNameArray in computerNamesArray)
{
var t = new Thread(() => searcher(computerNameArray, sidToSearchFor));
t.IsBackground = true;
t.Start();
}
private List<string> searcher(List<string> computerNames, string sidToSearchFor)
{
List<string> returnValue = null;
//do stuff here
return returnValue;
}
modified 2-Feb-15 10:40am.
|
|
|
|
|
Passing a value into a Thread is pretty easy:
Thread t = new Thread(DoWork);
t.Start("hello there");
}
private void DoWork(object o)
{
string s = o as string;
if (s != null)
{
Console.WriteLine(s);
}
}
Getting a return value is a lot harder!
If I needed a return value, I'd probably do it via a BackgroundWorker instead of a Thread, because that makes it really easy:
BackgroundWorker work = new BackgroundWorker();
work.DoWork += work_DoWork;
work.RunWorkerCompleted += work_RunWorkerCompleted;
work.RunWorkerAsync("hello There");
}
private void work_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
Console.WriteLine(e.Result);
}
private void work_DoWork(object sender, DoWorkEventArgs e)
{
string s = e.Argument as string;
if (s != null)
{
Console.WriteLine(s);
}
e.Result = string.Format("{0}: Complete", e.Argument);
}
Because Argument and Result are both objects, you can pass any type you like in and out.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Dear everyone
I already development application using OCR in C# handwriting recognition inventory ticket ( using A4 size). but sometime number of rows and columns are different with same template. could everyone can help me fix it? it is very impotance with me. I already up load my code in here. please help me.
thank you.
trtreterte
modified 8-Feb-15 4:37am.
|
|
|
|
|
rosy84 wrote: it is very impotance with me. so i can not upload here. You're asking for free consultancy here, complete with confidentiality.
I don't think that it will attract a lot of usefull replies.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I know that but in here I cannot upload inventory images and any think like that. i kow in here is free.
thank you for your comment.
trtreterte
|
|
|
|
|