image-manipulation

BlackBerry - Cropping image

倖福魔咒の 提交于 2019-12-01 11:51:59
问题 I want to crop a part of Image, for that I am using following code: int x=20; int y=50; int [] rgbdata=new int[(0+width-x+height-y)* (image.getWidth())]; image.getARGB(rgbdata, 0, image.getWidth(), x, y, width, height); cropedImage=new Bitmap(image.getWidth(),image.getWidth()); cropedImage.setARGB(rgbdata, 0,image.getWidth(), 80,80, width, height); x an y are the position from where the cropping will be done in the rectangular form. but it is not working. 回答1: you can do this using graphics:

Tint a partially transparent image in WPF

眉间皱痕 提交于 2019-12-01 09:06:45
How can I tint/colorize an image in WPF (using MVVM) without sacrificing performance? A purely XAML solution would be ideal, as modifying bitmaps in the code will cause performance loss with lots of changing images. The image is made up of more than simple shapes, so it is not possible using a path. Cyral Unlike WinForms/GDI+, WPF does not seem to contain any easy ways to colorize/tint an image as it is being rendered. Two ideas for accomplishing this are, using a shader, or overlaying a colored rectangle over the image. I decided to try the rectangle route and found that it works. Basically,

CSS or JavaScript to highlight certain area of image opacity

做~自己de王妃 提交于 2019-12-01 08:31:43
I'm looking to do something like this but with CSS or JavaScript. I need to highlight a certain part of an image but everything I find is how to do it in Photoshop. Can I do this with CSS or maybe JavaScript? Am I even asking the right question? EDIT: Well here is a great submission but I have a follow up question: I need this for a mobile device and portrait and landscape views as well for many devices like: iOS, iPad, Android, WebOS, Etc... So the fixed position I'm not sure will work. Any advice? You could use background-position with absolutely positioned divs as follows: CSS: .container {

How to tile a 30000 x 6000 image for a 480 x 320 screen?

天大地大妈咪最大 提交于 2019-12-01 08:02:19
问题 (this is related to another question about implementation on iPhone) I have a large image, size around 30000 (w) x 6000 (h) pixels. You may consider it's like a big map. I assume I need to crop it up into smaller tiles. Questions: what is the tile strategy? Requirements: whole image (though cropped) can be scrolled up/down/left/right by swipes zoom in (up to pixel-to-pixel) out (down to screen-fit-by-height) by the 2-finger operation memory efficiency by lazy loading tiles Thanks! 回答1: Check

CSS or JavaScript to highlight certain area of image opacity

北慕城南 提交于 2019-12-01 07:52:40
问题 I'm looking to do something like this but with CSS or JavaScript. I need to highlight a certain part of an image but everything I find is how to do it in Photoshop. Can I do this with CSS or maybe JavaScript? Am I even asking the right question? EDIT: Well here is a great submission but I have a follow up question: I need this for a mobile device and portrait and landscape views as well for many devices like: iOS, iPad, Android, WebOS, Etc... So the fixed position I'm not sure will work. Any

iOS: Drawing just portions of a UImage

邮差的信 提交于 2019-12-01 06:22:20
问题 I am trying to draw just a custom portion of a UIImage (i.e.: I would like to reveal the portion of the UIImage user touches) and I am having reasonable results by using mask property of the layer . Something like this on my UIView : UIBezierPath *maskPath = [UIBezierPath bezierPath]; [maskPath setLineWidth:10.0]; [maskPath moveToPoint:CGPointMake(10.0, 10.0)]; [maskPath addLineToPoint:CGPointMake(100.0, 100.0)]; CAShapeLayer *shapeMaskLayer = [CAShapeLayer layer]; shapeMaskLayer.path =

How do I rotate an image in the frequency domain?

点点圈 提交于 2019-12-01 05:54:08
I've heard that it should be possible to do a lossless rotation on a jpeg image. That means you do the rotation in the frequency domain without an IDCT. I've tried to google it but haven't found anything. Could someone bring some light to this? What I mean by lossless is that I don't lose any additional information in the rotation. And of course that's probably only possible when rotating multiples of 90 degrees. mpenkov You do not need to IDCT an image to rotate it losslessly (note that lossless rotation for raster images is only possible for angles that are multiples of 90 degrees). The

Non-Affine image transformations in .NET

妖精的绣舞 提交于 2019-12-01 04:45:56
Are there any classes, methods in the .NET library, or any algorithms in general, to perform non- affine transformations? (i.e. transformations that involve more than just rotation, scale, translation and shear) e.g.: (source: last100.com ) Is there another term for non-affine transformation s? All of the example images you posted can be done with a Quadrilateral Distortion. Though I cant say for certain that a quad distort will cover ALL non affine transforms. Heres a link to a not so good implementation of it in C#... it works, but is slow. Poke around Wikipedia for the many different

move_uploaded_file doesn't work, no error

ぃ、小莉子 提交于 2019-12-01 04:25:46
I am running running a script which moves an uploaded file with move_uploaded_file() . I have done this thousands of times but for some reason it's not working. I have confimred the following: <form> using method="post" and correct enctype correct file referenced from form directory has permissions 777 all the memory_limit , max_execution_time , etc are set to super high settings to avoid timeouts Basically, the script below returns with just Your image is too big. . I have also enabled ALL errors to display and still don't get an error. Any ideas? $time = time(); $target_path = "/absolute

Can you open a JPEG, add text, and resave as a JPEG in .NET?

浪尽此生 提交于 2019-12-01 03:48:43
问题 I want to write a small program in .NET 4.0 that will open a .jpg (or .jpeg) file, add a line of text to the image, and then resave the image as a .jpg. Does anyone know the easiest way to do this? Thanks for any help. 回答1: Something like this: var filePath = @"D:\Pictures\Backgrounds\abc.jpg"; Bitmap bitmap = null; // Create from a stream so we don't keep a lock on the file. using (var stream = File.OpenRead(filePath)) { bitmap = (Bitmap)Bitmap.FromStream(stream); } using (bitmap) using (var