You are saying that bitmap is BGR, but I tried using SetPixel with RGB pattern and it worked fine. Does SetPixel works differently than copying RGB data?
Jaffer Mumtaz
Posts
-
Problem Copying Raw RGB Data to Bitmap -
Problem Copying Raw RGB Data to BitmapThanks for the timely reply Luc. Can you give some pointers/links/example on how to apply ColorMatrix? Thanks and Regards,
-
Problem Copying Raw RGB Data to BitmapHi All, I am using the following function to copy RAW RGB byte array to Bitmap object. The problem I am facing is when I copy the byte array content through SetPixel method, Image construction is OK and color are proper on the Bitmap. But when I try to use the following function it some how swaps the Red and Blue bytes in the Bitmap causing wrong colors on the Image.
static int WriteBitmapFile(string filename, int width, int height, byte[] imageData)
{
using (Bitmap bmp = new Bitmap(width, height, PixelFormat.Format24bppRgb))
{
BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0,bmp.Width,bmp.Height),ImageLockMode.WriteOnly,bmp.PixelFormat);
Marshal.Copy(imageData, 0, bmpData.Scan0, imageData.Length);
bmp.UnlockBits(bmpData);
bmp.Save(filename);
}
return 1;
}It seems though when I am copying the byte array in one go it swaps the Red and Blue bytes. SetPixel works fine but is too slow. Any help in this regard is highly appreciated. Regards,
-
VB.NET read rows using drYou can loop through the DataReader and check for records.
While DataReader.Read()
-
Unable to access connection string from app configPaste the code of your app.config and the code which you are calling to access it
-
Unable to access connection string from app configHi, Try using the following
System.Configuration.ConfigurationSettings.AppSettings("ConnectionString").ToString()
and in app.config
<appSettings>
<add key="ConnectionString" value="Data Source=MyData;Initial Catalog=Data;Integrated Security=False;User id=abcd;Password=1234;"/>
</appSettings> -
performance issues in web applicationHi, Just visit the link below: http://www.oreillynet.com/pub/a/javascript/2002/06/27/web_tuning.html[^] Also make sure that in your production environment compression for webpages is on. To analyze performance visit http://www.pipeboost.com/[^] http://www.websiteoptimization.com/services/analyze/[^] Regards
-
session in asp.net & c#.netWhat is the problem
-
How can we keep calling OnStart() in Started condition of Windows Service in C#Hi, You could place a timer control on your service and do your programming logic in timer elapse event. Set the timer elapse time say 10 seconds or what ever you want and launch your exe. cheers
-
Query HelpHi, Thanks for the answer. You know i could call a function but the thing is this query is a part of function being called from stored procedure. My scenario is complex and calling another function will effect the procedure performance further as currently procedure takes 5 seconds to execute. So I was looking for something if we could accomplish it through SQL. Though thanks anyways. Regards,
-
Query HelpHi, I have the following query
SELECT iAccountID,iViolatorID,Count(iViolatorID) FROM tbTempQNotificationRequest (NOLOCK)
WHERE IsProcessed = 0 AND sdtStatusDate >= @sdtCurrentDate AND sdtStatusDate < @sdtCurrentDate + 1
GROUP BY iAccountID,vcGroupByValue,iViolatorIDIs it possible say when I group by the result set return iAccount|iViolatorID|Count 1-------|1----------|3 2-------|2----------|5 I would like to have a fourth column say AccountNo and I want that it should contain comma seperated values of AccountNo against the group by columns.e.g. iAccount|iViolatorID|Count|AcccountNo 1-------|1----------|3----|X12,X23,X34 2-------|2----------|5----|X45,X56,X65,X32,X98 I hope my question is clear and understandable
-
Windows ServicesHi, You can simply schedule the service through Scheduled Tasks in windows. Go to control panel --> Scheduled Task and add a new task for your service. You can install your service as well and it will run in the background and performs your task according to your requirements. Regards,
-
iframe question(control the scroll bar)Please explain where have you placed your script and from where do you call it. Just try to alert something in the script to check if its even called or not.
-
A font issue in CSS !Hi, Use
.productText{
font-family:CHANL;
font: bold 36pt ;
color: #b3c800;
padding-left: 11px;
}Hope this helps
-
How to access Other sql database form web formsHi, Are you using 2 sql servers? Because from the description i am still unable to completely understand your problem. What i understand from your description is you might be having 2 sql servers one called pups. Okay when pups clients access pups application over web you might say you establish connection to the server using connection string 1 hitting pups database server. And when you need to connect to another database server you should use connection string 2. This logic should be embedded in your program to determine which database it should access at any particular moment. I am assuming you know about connection string and know how to connect to a sql server in asp.net
-
How to access Other sql database form web formsHi, I am not sure what you meant by another sql server. Yes you can connect to multiple sql server through your website. Its up to you how you manage your connections. You could use GridView, DataList etch controls to access your Db but not sure what exactly you are trying to achieve.
-
need to make an asynchronous call to a method that accepts arguments and then modifies formHi, Have a look at the link. Hope this helps. http://en.csharp-online.net/CSharp_Delegates_and_Events%E2%80%94Asynchronous_method_calls[^]
-
windows serviceHave a look at the link. Hope you will extract information out of it. http://www.codeproject.com/KB/install/csharpsvclesson2.aspx[^]
-
html coding in stored procedureHi, This is not a asp.net question, but if you are trying to concatenate HTML string with database column , yes you can do that
-
windows serviceHi, Windows services are program that runs in the background forever, however if you want to start your service at a particular time you will have to implement service controller. But i dont know why you want to do that. Just implement timer control and check for the event at which you want your windows service to do something Regards