pixel

Windows Store Apps - XAML - Scrollviewer - Turn on pixelsnapping for image inside scrollveiwer

谁说我不能喝 提交于 2019-12-13 01:23:47
问题 I have an 'Image' inside a 'Scrollviewer'. When I zoom in I want to see the true pixel values, what some people refer to as pixel snapping. I don't want my image anti-aliased. I want it to look pixelated. Similar to if you zoomed in using MS Paint. Is there an option in 'ScrollViewer' or 'Image' to accomplish this? 来源: https://stackoverflow.com/questions/29131220/windows-store-apps-xaml-scrollviewer-turn-on-pixelsnapping-for-image-insid

Multiply each pixel in an image by a factor

谁都会走 提交于 2019-12-12 19:51:34
问题 I have an image that is created by using a bayer filter and the colors are slightly off. I need to multiply RG and B of each pixel by a certain factor ( a different factor for R, G and B each) to get the correct color. I am using the python imaging library and of course writing in python. is there any way to do this efficiently? Thanks! 回答1: Here is how to do it: First split your image into the RGB channels. Use point to multiply a channel by factor ( 1.5 in the example, on the r channel).

Trying to understand Bitmap.Config.ARBG_8888

和自甴很熟 提交于 2019-12-12 19:18:51
问题 I'm trying to understand packing of color bytes for ARGB_8888 format. The documentation states that packing should be done using this formula: int color = (A & 0xff) << 24 | (B & 0xff) << 16 | (G & 0xff) << 8 | (R & 0xff); But shouldn't it be instead: int color = (A & 0xff) << 24 | (R & 0xff) << 16 | (G & 0xff) << 8 | (B & 0xff); When I unpack a sample pixel from a ARGB_8888 color encoded bitmap that has all red pixels, I'm using: final int r = (p >> 16) & 0xff; final int g = (p >> 8) & 0xff;

Website looks too small/zoomed out on iPhone

天涯浪子 提交于 2019-12-12 17:22:33
问题 I am working on a website right now that looks great in a normal web browser and on the older smart phones, but it is way too small on the iPhone. I think this is because the iPhone takes a large number of pixels and squeezes them on to a smaller screen rather than being true-to-size. Is there a way to make the entire site look more zoomed-in / large on the phone screen without having the create a separate mobile site? UPDATE: This is the code I tried using. The website looked the same when I

Qt Android. Get device screen resolution

孤街醉人 提交于 2019-12-12 16:24:16
问题 I'm developing in qt 5.3 on android device. I can't get the screen resolution. With the old qt 5 version this code worked: QScreen *screen = QApplication::screens().at(0); largh=screen->availableGeometry().width(); alt =screen->availableGeometry().height(); However now it doesn't work (returns a screen size 00x00). Is there another way to do it? thanks 回答1: Size holds the pixel resolution screen->size().width() screen->size().height(); Whereas, availableSize holds the size excluding window

How to get pixel coordinates of a pixel inside an html5 canvas

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 09:22:59
问题 I know that you can get the value of each pixel inside the html5 Canvas using getImageData() and .data() but is there a way to get their coordinates and not just their values? 回答1: var w = ctx.canvas.width, h = ctx.canvas.height; var id = ctx.getImageData(0,0,w,h); var d = id.data; for (var y=0;y<h;++y){ for (var x=0;x<w;++x){ var i=(y*w+x)*4; var r=d[i],g=d[i+1],b=d[i+2],a=d[i+3]; } } It's just as easy to derive the x/y from the index while looping through the image data array, or to add in

Changing RGB color image to Grayscale image using Objective C

房东的猫 提交于 2019-12-12 08:52:22
问题 I was developing a application that changes color image to gray image. However, some how the picture comes out wrong. I dont know what is wrong with the code. maybe the parameter that i put in is wrong please help. UIImage *c = [UIImage imageNamed:@"downRed.png"]; CGImageRef cRef = CGImageRetain(c.CGImage); NSData* pixelData = (NSData*) CGDataProviderCopyData(CGImageGetDataProvider(cRef)); size_t w = CGImageGetWidth(cRef); size_t h = CGImageGetHeight(cRef); unsigned char* pixelBytes =

Non integer offset positions in jQuery

蓝咒 提交于 2019-12-12 08:39:52
问题 jQuerys offset function sometimes returns rational numbers (like 12.645613) for top or left. I thought that top and left positions are in pixels and so should be integers (there are no half pixel, or?). 回答1: Top and left positions can be floating point numbers with any of the units cm, mm, in, pt, pc, em, ex or px, or percentages. Example: .someElement { top: 42%; left: 3.14in; } The offset function returns the position translated into pixels, so that can very well be a floating point number.

Processing: Draw vector instead of pixels

笑着哭i 提交于 2019-12-12 04:24:40
问题 I have a simple Processing Sketch, drawing a continuous line of ellipses with a 20px diameter. Is there a way to modify the sketch so that it draws vector shapes instead of pixels? void setup() { size(900, 900); background(110, 255, 94); } void draw() { ellipse(mouseX, mouseY, 20, 20); fill(255); } Thanks to everyone who can provide some helpful advice. 回答1: Expanding my comment above, there a couple of things to tackle: drawing a continuous line of ellipses with a 20px diameter draws vector

setpixel of QGraphicsScene in Qt

南楼画角 提交于 2019-12-12 03:19:41
问题 It's simple to draw line or ellipse just by using scene.addellipse(), etc. QGraphicsScene scene(0,0,800,600); QGraphicsView view(&scene); scene.addText("Hello, world!"); QPen pen(Qt::green); scene.addLine(0,0,200,200,pen); scene.addEllipse(400,300,100,100,pen); view.show(); now what should i do to set some pixel color? may i use a widget like qimage? by the way performance is an issue for me.thanks 回答1: I think that performing pixel manipulation on a QImage would slow down your application