I've got a Windows Forms application (C#) and I have several cursors that I've drawn which I want to be able to embed in the application. I am able to load the cursors from a file, but not as an embedded resource. Can anyone give me some pointers about how this is accomplished? I am using VisualStudio.Net. Thanks.
jstonge
Posts
-
VS.Net embedding cursors -
.NET application to native code?I have a .NET application and I'd like to distibute it in 2 forms: 1. As is. 2. Compiled to run on a Windows systems which may not have the .NET framework. Is there a way to get a native application from a collection of assemblies? I looked into the ngen.exe program, but this appears to only pre-compile assemblies into an internal cache.
-
Best way to decode raw JPEG data?Thanks Jonathon, I did this after getting your message. It works pretty well but, unfortunately, GDI+ also does not recognize the JPEG file that I'm using. Still, I'm going to stick with the GDI+ implementation. I can still read any lossy JPEGs that I've found, I just haven't been able to read the lossless JPEG files. I tested some competing products and they also could not read the lossless JPEGs, so I'm going to ignore the problem for the time being. Thanks again, and here is the uncommented CPP file of the class I wrote: #include "StdAfx.h" #include "JPegDecoderGdiPlus.h" #include "LImage.h" // my image class: contains my IMGFMT_* enumerations using namespace Lorus::UImageProcessing; JPegDecoderGdiPlus::JPegDecoderGdiPlus(void) { m_valid = false; m_gdiPlusBitmap = NULL; GdiplusStartupInput gdiplusStartupInput; GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL); } JPegDecoderGdiPlus::~JPegDecoderGdiPlus(void) { m_valid = false; delete m_gdiPlusBitmap; GdiplusShutdown(m_gdiplusToken); } // LDataSource is the source of the raw image data. It has a method 'CreateStream' that // creates an IStream* object. LDataSource is in my lowest-level library and is just a generic way // for me to contain data that other objects can access. bool JPegDecoderGdiPlus::InitializeDecode(LDataSource *imgSource) { m_valid = false; if (!imgSource) return false; IStream *istrm = imgSource->CreateStream(); if (!istrm) return false; m_gdiPlusBitmap = Bitmap::FromStream(istrm); istrm->Release(); return true; } bool JPegDecoderGdiPlus::ReadHeader(void) { return true; } bool JPegDecoderGdiPlus::ReadScanLines(void *dst, ULONG dstStride) { if (!dst) return false; if (!m_gdiPlusBitmap) return false; int width = ImageWidth(); int height = ImageHeight(); int depth = PixelDepth(); if (width==0 || height==0) return false; PixelFormat lockPixelFormat; switch (GetImageFormat()) { case IMGFMT_MONOCHROME1: case IMGFMT_MONOCHROME2: case IMGFMT_PALETTECOLOR: if (depth == 8) lockPixelFormat = PixelFormat8bppIndexed; else lockPixelFormat = PixelFormat16bppGrayScale; break; case IMGFMT_RGB: case IMGFMT_HSV: case IMGFMT_ARGB: case IMGFMT_CMYK: case IMGFMT_YBR_FULL: case IMGFMT_YBR_FULL_422: case IMGFMT_YBR_PARTIAL_422: lockPixelFormat = PixelFormat32bppARGB; break; case IMGFMT
-
Best way to decode raw JPEG data?I have an application where I have raw JPEG data in a memory buffer. I need to convert this to a raw image in memory and it needs to be pretty fast. I tried the IJG software, and it works for most images that I have, but I have a number of lossless JPEG images that it dies on. Specifically, it errors out because it encounters an SOF3 tag. I'm targeting Windows 2000/NT/XP for this. My ideas: 1. Wrap my raw JPEG data into a COM class supporting IStream. Send the IStream to GDI+ to create an image. But then what do I do with the image??? I can't figure out how get the raw data out of it without saving it to another IStream as a BMP and then decoding the bitmap. This just seems like a lot of extra overhead and I'd like to find a better solution. 2. Use a codec to do this. However, I've not been able to find information on how to work with a codec. 3. Try to decipher the IJG software and handle/ignore the SOF3 tag. Any other ideas? Anyone know how to use a codec or whether a codec could do this? Thanks. (Sorry if this post appears twice, I pushed submit and it made me login and I don't know if the first submit actually went through)
-
Update database without SQL???First of all, I'm not an expert on data access. But in my trials and tribulations with ADO.Net and ADO I've yet to find a way to update a database without it using SQL to do its work. It seems to me that if I have a large recordset that I create which I want to add to a database, it should be doable without the overhead of converting to SQL and then having the DBMS unconvert it on its side. Is this possible with ADO.Net, and if so, how? Let's say that I have a simple table in the database with 200 double-precision floating point fields. If at some point, I have 4,000 rows to add to the table (6,400,000 bytes of data) how can I add this data to the database as efficiently as possible? It seems to me that converting everything to a text command in SQL when I already have the data formatted as a 4000x200 table is inefficient.