imaging

How to convert a image file loaded in memory to a ID2D1Bitmap in C++

懵懂的女人 提交于 2019-12-06 16:36:23
I'm trying to convert a image file (a png, but could be anything) that I just extracted into memory from a compressed file to a ID2D1Bitmap to draw using Direct 2D. I tried to look for some documentation, but I can only find methods that receive "const char* path" or ask me width and height of my image, that I can't know before-hand. Searching on google for it got me nowhere. The file is raw in memory, and I would like to avoid to extract images to the hdd into a temporary file just to read their data from there. Any ideas? if you have the HBITMAP handle, you can do this: The the size of your

Storage Commitment Service (push model): how i get the result back to my SCU?

心已入冬 提交于 2019-12-06 13:29:26
I planned to implement a Storage Commitment Service to verify if files previously sent to the storage were safely stored. My architecture is very simple and straightforward my SCU sends some secondary capture images to the storage and I want to be sure they are safely stored before delete them. I am going to adopt push model and I wonder what steps/features I need to implement to accomplish the service What I understood is I need to issue a N-ACTION request with SOP Class UID 1.2.840.10008.1.20.1 and add to the request a transaction identifier together with a list of Referenced SOP Class UID –

Create a Bigtiff (>4GB) File with Bitmiracle Libtiff.net

我的梦境 提交于 2019-12-06 06:34:05
First I want to thank Bitmiracle for this great lib. Even while creating very big files, the memory footprint is very low. A few days ago I ran into a problem where I wanted to create a tiff file bigger than 4GB. I created the tiled tiff file successfully, but it seems that the color of the tiles created beyond 4GB are somehow inverted. Here the code relevant code: Usage: WriteTiledTiff("bigtiff.tiff",BitmapSourceFromBrush(new RadialGradientBrush(Colors.Aqua,Colors.Red), 256)); Methods: public static BitmapSource BitmapSourceFromBrush(Brush drawingBrush, int size = 32, int dpi = 96) { //

Tool for lossless image compression [closed]

妖精的绣舞 提交于 2019-12-06 03:14:42
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Running Google Page Speed on a public site , I saw some suggestions by the tool like the following : Losslessly compressing http://g-ecx.images-amazon.com/images/G/01/electronics/detail-page/Acer-120x120._V137848950_.gi could save 4.8KiB (26% reduction) and they also provide a link to the optimized content.But

Using PIL to detect a scan of a blank page

给你一囗甜甜゛ 提交于 2019-12-06 02:58:39
问题 So I often run huge double-sided scan jobs on an unintelligent Canon multifunction, which leaves me with a huge folder of JPEGs. Am I insane to consider using PIL to analyze a folder of images to detect scans of blank pages and flag them for deletion? Leaving the folder-crawling and flagging parts out, I imagine this would look something like: Check if the image is greyscale, as this is presumed uncertain. If so, detect the dominant range of shades (background colour). If not, detect the

How to draw unicode characters on transparent image in PIL

血红的双手。 提交于 2019-12-06 02:33:42
I am trying to draw certain unicode characters on and image using python (PIL to be precise). Using the following code I can generate the images with a white background: ('entity_code' is passed in to the method) size = self.font.getsize(entity_code) im = Image.new("RGBA", size, (255,255,255)) draw = ImageDraw.Draw(im) draw.text((0,6), entity_code, font=self.font, fill=(0,0,0)) del draw img_buffer = StringIO() im.save(img_buffer, format="PNG") I tried the following: ('entity_code' is passed in to the method) img = Image.new('RGBA',(100, 100)) draw = ImageDraw.Draw(img) draw.text((0,6), entity

Storage Commitment Service: why I really need a what is the real purpose?

送分小仙女□ 提交于 2019-12-05 13:14:20
I'm wondering why I really need of commitment after a c-store command; I can understand the commit is a sort of assurance about the fact the message was actually taken in charge by the storage and the storage takes the responsibility of it, but I wonder why is not safe enough to rely on the response status ? I read some explanations about that but none convinced me all the way. As far as I understood a commit can be required or better desirable basically because you can not totally trust the system you are sending the message to. Well it sound like: when you insert a record in a database table

WIA 2.0 Duplex property

拟墨画扇 提交于 2019-12-05 11:51:13
I am developing an aplication with C# to use the WIA 2.0 library. At the moment I could use most of the features, such as ADF (auto document feeder), filters and more. Now, I need to use the duplexer of my scanner (fujitsu). I'm trying to set the WIA_DPS_DOCUMENT_HANDLING_SELECT scanner property to the DUPLEX value. See the code below: try { bool hasMorePages = false; //determine if there are any more pages waiting Property documentHandlingSelect = null; Property documentHandlingStatus = null; foreach (Property prop in WiaDev.Properties) { if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT

Merge png images into single image in WPF

 ̄綄美尐妖づ 提交于 2019-12-05 07:19:46
I'm looking for a way to Merge some PNG tile images into a big image. So I search and found some links. This is not answered properly. This is not tiling, it's good for overlaying images and this is not using WPF. So I'm making this question. Problem Definition: I have 4 PNG images. I want to merge them into a single PNG image, like this ------------------- | | | | png1 | png2 | | | | ------------------- | | | | png3 | png4 | | | | ------------------- Question: What is the best and efficient way of doing this (The resulting image must be PNG)? // Loads the images to tile (no need to specify

Using pixel fonts in PIL

随声附和 提交于 2019-12-05 04:28:08
I am creating images using PIL that contain numerous exactly placed text strings. My first attempt was to convert pixel fonts into the pil-compatible format as described here . For example, I download the Silksreen font and convert it: otf2bdf -p 8pt -o fonts/slkscr.bdf fonts/slkscr.ttf pilfont.py fonts/slkscr.bdf I can then use the font in PIL like so: import Image, ImageDraw, os, sys, ImageFont im = Image.new("RGB", (40,10)) draw = ImageDraw.Draw(im) fn = ImageFont.load('fonts/slkscr.pil') draw.text((0,0), "Hello", font=fn) del draw # write to stdout im.save(sys.stdout, "PNG") However, the