Search Results

Search found 24094 results on 964 pages for 'image processing'.

Page 9/964 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Where will the image be saved? [closed]

    - by Dummy Derp
    import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import java.io.File; ... public void captureScreen(String fileName) throws Exception { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Rectangle screenRectangle = new Rectangle(screenSize); Robot robot = new Robot(); BufferedImage image = robot.createScreenCapture(screenRectangle); ImageIO.write(image, "png", new File(fileName)); } ... Going over this code I found on the internet. I got everything except the part where file is created. In what format file name should be? Should it be C:/myFolder/myImage.png" or just myImage.png and where will it be saved? Here is what docs say: File public File(String pathname) Creates a new File instance by converting the given pathname string into an abstract pathname. If the given string is the empty string, then the result is the empty abstract pathname. Parameters: pathname - A pathname string Throws: NullPointerException - If the pathname argument is null

    Read the article

  • Image mapping using lookup tables [on hold]

    - by jblasius
    I have an optimization problem. I'm using a look-up table to map a pixel in an image: for (uint32_t index = 0u; index < imgSize; index++) { img[ lt[ index ] ] = val; } Is there a faster way to do this, perhaps using a reinterpret_cast or something like that? I am accessing two different memory addresses, so what is the compiler doing? One solution is to do a set of reads to access adjacent memory addresses. struct mblock { uint32_t buf[10u]; }; mblock mb; for (uint32_t index = 0u; index < imgSize; index += 10u) { mb = *reinterpret_cast<mblock*>(lt + index)); for (uint8_t i = 0u; i < 10u; i ++) { mb.buf[i] += img; } for (uint8_t i = 0u; i < 10u; i ++) { *( mb.buf[i] ) = val; } } This speeds up the code because I'm separating the image access from the table look-up; the positions in the look-up table are adjacent. I still get the image access problem as it is accessing random address positions.

    Read the article

  • Ideas on frameworks in .NET that can be used for job processing and notifications

    - by Rajat Mehta
    Scenario: We have one instance of WCF windows service which exposes contracts like: AddNewJob(Job job), GetJobs(JobQuery query) etc. This service is consumed by 70-100 instances of client which is Windows Form based .NET app. Typically the service has 50-100 inward calls/minute to add or query jobs that are stored in a table on Sql Server. The same service is also responsible for processing these jobs in real time. It queries database every 5 seconds picks up the queued jobs and starts processing them. A job has 6 states. Queued, Pre-processing, Processing, Post-processing, Completed, Failed, Locked. Another responsibility on this service is to update all clients on every state change of every job. This means almost 200+ callbacks to clients per second. Question: This whole implementation is done using WCF Duplex bindings and works perfectly fine on small number of parallel jobs. Problem arises when we scale it up to 1000 jobs at a time. The notifications don't work as expected, it leads to memory overflow etc. Is there any standard framework that can provide a clean infrastructure for handling this scenario?? Apologies for the long explanation!

    Read the article

  • IE6 image scaling with bicubic filter

    - by thehuby
    I have a project where I have to resize some images in the actual browser side. IE8, FF3 et al all apply a filter to smooth the resizing of the image, so in these browsers everything looks good. In IE7 I have applied the following fix which works great: -ms-interpolation-mode:bicubic; In IE6 however I can only find references to the AlphaImage Filter (the same one used to enable alpha transparency on PNG files). However I can't find an example of how to use it, nor have I been able to get it working myself. Can anyone provide me with an example? Preferably applied to actual img tags, though I could use background images if required. MSDN link (for what its worth): http://msdn.microsoft.com/en-us/library/ms532969%28VS.85%29.aspx The code I am using in my CSS is applied to the img, though I've tried applying it to the img container as well (with no effect): #provider-list li img { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/image.gif", sizingMethod="scale"); } A thousand thank you's in advance :) Rick

    Read the article

  • PHP - Resize an image and fill gaps of proportions with a color

    - by Kerry
    I am uploading logos to my system, and they need to fix in a 60x60 pixel box. I have all the code to resize it proportionately, and that's not a problem. My 454x292px image becomes 60x38. The thing is, I need the picture to be 60x60, meaning I want to pad the top and bottom with white each (I can fill the rectangle with the color). The theory is I create a white rectangle, 60x60, then I copy the image and resize it to 60x38 and put it in my white rectangle, starting 11px from the top (which adds up to the 22px of total padding that I need. I would post my code but it's decently long, though I can if requested. Does anyone know how to do this or can you point me to code/tutorial that does this?

    Read the article

  • Image loader cant load my live image url

    - by Bindhu
    In my application i need to load the images in list view, when using locale(ip ported url) then no problem all images are loading properly, But when using live url then the images are not loading, My image loader class: public class ImageLoader { MemoryCache memoryCache = new MemoryCache(); FileCache fileCache; private Map<ImageView, String> imageViews = Collections .synchronizedMap(new WeakHashMap<ImageView, String>()); ExecutorService executorService; public ImageLoader(Context context) { fileCache = new FileCache(context); executorService = Executors.newFixedThreadPool(5); } final int stub_id = R.drawable.appointeesample; public void DisplayImage(String url, ImageView imageView) { imageViews.put(imageView, url); Bitmap bitmap = memoryCache.get(url); if (bitmap != null) imageView.setImageBitmap(bitmap); else { Log.d("stub", "stub" + stub_id); queuePhoto(url, imageView); imageView.setImageResource(stub_id); } } private void queuePhoto(String url, ImageView imageView) { PhotoToLoad p = new PhotoToLoad(url, imageView); executorService.submit(new PhotosLoader(p)); } private Bitmap getBitmap(String url) { File f = fileCache.getFile(url); // from SD cache Bitmap b = decodeFile(f); if (b != null) return b; // from web try { Bitmap bitmap = null; URL imageUrl = new URL(url); HttpURLConnection conn = (HttpURLConnection) imageUrl .openConnection(); conn.setConnectTimeout(30000); conn.setReadTimeout(30000); conn.setInstanceFollowRedirects(true); InputStream is = conn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is, 81960); BitmapFactory.Options opts = new BitmapFactory.Options(); opts.inJustDecodeBounds = true; OutputStream os = new FileOutputStream(f); Utils.CopyStream(bis, os); os.close(); bitmap = decodeFile(f); Log.d("bitmap", "Bit map" + bitmap); return bitmap; } catch (Exception ex) { ex.printStackTrace(); return null; } } // decodes image and scales it to reduce memory consumption private Bitmap decodeFile(File f) { try { try { BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeStream(new FileInputStream(f), null, o); final int REQUIRED_SIZE = 200; int scale = 1; while (o.outWidth / scale / 2 >= REQUIRED_SIZE && o.outHeight / scale / 2 >= REQUIRED_SIZE) scale *= 2; BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inSampleSize = scale; return BitmapFactory.decodeStream(new FileInputStream(f), null, o2); } catch (FileNotFoundException e) { } finally { System.gc(); } return null; } catch (Exception e) { } return null; } // Task for the queue private class PhotoToLoad { public String url; public ImageView imageView; public PhotoToLoad(String u, ImageView i) { url = u; imageView = i; } } class PhotosLoader implements Runnable { PhotoToLoad photoToLoad; PhotosLoader(PhotoToLoad photoToLoad) { this.photoToLoad = photoToLoad; } @Override public void run() { if (imageViewReused(photoToLoad)) return; Bitmap bmp = getBitmap(photoToLoad.url); memoryCache.put(photoToLoad.url, bmp); if (imageViewReused(photoToLoad)) return; BitmapDisplayer bd = new BitmapDisplayer(bmp, photoToLoad); Activity a = (Activity) photoToLoad.imageView.getContext(); a.runOnUiThread(bd); } } boolean imageViewReused(PhotoToLoad photoToLoad) { String tag = imageViews.get(photoToLoad.imageView); if (tag == null || !tag.equals(photoToLoad.url)) return true; return false; } // Used to display bitmap in the UI thread class BitmapDisplayer implements Runnable { Bitmap bitmap; PhotoToLoad photoToLoad; public BitmapDisplayer(Bitmap b, PhotoToLoad p) { bitmap = b; photoToLoad = p; } public void run() { if (imageViewReused(photoToLoad)) return; if (bitmap != null) photoToLoad.imageView.setImageBitmap(bitmap); else photoToLoad.imageView.setImageResource(stub_id); } } public void clearCache() { memoryCache.clear(); fileCache.clear(); } My Live Image url for Example: https://goappointed.com/images_upload/3330Torana_Logo.JPG I have referred google but no solution is working, Thanks a lot in advance.

    Read the article

  • Simple but efficient way to store a series of small changes to an image?

    - by finnw
    I have a series of images. Each one is typically (but not always) similar to the previous one, with 3 or 4 small rectangular regions updated. I need to record these changes using a minimum of disk space. The source images are not compressed, but I would like the deltas to be compressed. I need to be able to recreate the images exactly as input (so a lossy video codec is not appropriate.) I am thinking of something along the lines of: Composite the new image with a negative of the old image Save the composited image in any common format that can compress using RLE (probably PNG.) Recreate the second image by compositing the previous image with the delta. Although the images have an alpha channel, I can ignore it for the purposes of this function. Is there an easy-to-implement algorithm or free Java library with this capability?

    Read the article

  • Python Image Library, Close method

    - by DNN
    Hello, I have been using pil for the first time today. And I wanted to resize an image assuming it was larger than 800x600 and also create a thumbnail. I could do either of these tasks separately but not together in one method (I am doing a custom save method in django admin). This returns a "cannot identify image file" error message. The error is on the line "image = Image.open(self.photo)" after "#if image is size is greatet than 800 x 600 then resize image." I thought this may be because the image is already open, but if i remove the line I still get issues. So I thought I could try closing after creating a thumbnail and then reopening. But I couldn't find a close method.... This is my code: def save(self): #create thumbnail Thumb_Size = (75, 75) image = Image.open(self.photo) if image.mode not in ('L', 'RGB'): image = image.convert('RGB') image.thumbnail(Thumb_Size, Image.ANTIALIAS) temp_handle = StringIO() image.save(temp_handle, 'jpeg') temp_handle.seek(0) suf = SimpleUploadedFile(os.path.split(self.photo.name)[-1], temp_handle.read(), content_type='image/jpg') self.thumbnail.save(suf.name+'.jpg', suf, save=False) #if image is size is greatet than 800 x 600 then resize image. image = Image.open(self.photo) if image.size[0] > 800: if image.size[1] > 600: Max_Size = (800, 600) if image.mode not in ('L', 'RGB'): image = image.convert('RGB') image.thumbnail(Max_Size, Image.ANTIALIAS) temp_handle = StringIO() image.save(temp_handle, 'jpeg') temp_handle.seek(0) suf = SimpleUploadedFile(os.path.split(self.photo.name)[-1], temp_handle.read(), content_type='image/jpg') self.photo.save(suf.name+'.jpg', suf, save=False) #enter info to database super(Photo, self).save()

    Read the article

  • C# .NET : Is using the .NET Image Conversion enough?

    - by contactmatt
    I've seen a lot of people try to code their own image conversion techniques. It often seems to be very complicated, and ends up using GDI+ funciton calls, and manipulating bits of the image. This has got me wondering if I am missing something in the simplicity of .NET's image conversion call when saving an image. Here's the code I have Bitmap tempBmp = new Bitmap("c:\temp\img.jpg"); Bitmap bmp = new Bitmap(tempBmp, 800, 600); bmp.Save(c:\temp\img.bmp, //extension depends on format ImageFormat.Bmp) //These are all the ImageFormats I allow conversion to within the program. Ignore the syntax for a second ;) ImageFormat.Gif) //or ImageFormat.Jpeg) //or ImageFormat.Png) //or ImageFormat.Tiff) //or ImageFormat.Wmf) //or ImageFormat.Bmp)//or ); This is all I'm doing in my image conversion. Just setting the location of where the image should be saved, and passing it an ImageFormat type. I've tested it the best I can, but I'm wondering if I am missing anything in this simple format conversion, or if this is suffice?

    Read the article

  • Boot ISO image from GRUB4DOS on EFI machines

    - by Vladimir Tikhomirov
    I failed with loading ISO image (non-distro) from GRUB2 from USB stick, but found the way how I can boot the GRUB4DOS and then load the image from there. However, it doesn't work all the time and the questions is WHY it doesn't? Environment and loading process: We need to have EFI machine, USB stick, booting ISO, GRUB2 and GRUB4DOS. Last 3 on USB stick. Boot: USB - EFI loader - GRUB2 - GRUB4DOS - ISO image Configuration files To boot GRUB4DOS I use this from grub.cfg: menuentry "image.iso" { linux /syslinux/grub.exe --config-file="/menu.lst" } My menu.lst is here: timeout 20 default 0 title image.iso find --set-root --ignore-floppies --ignore-cd //image.iso map --heads=0 --sectors-per-track=0 //image.iso (hd32) map --hook chainloader (hd32) This works perfectly with Legacy machines. However, when I come to GRUB4DOS, I don't see the menu with image.iso, I see only GRUB command line. That means that my menu.lst didn't load. Why is it like this? Background and ideas I have an idea that GRUB4DOS doesn't recognize my USB stick as a device. I tried the command find and got (hd0,0), (hd0,1), (hd0,2), (rd). When I tried to set root to any of these devices I don't see fat file system, how it was with Legacy machines. The root device is (hd0,0), which has ntfs file system which should be partition with Windows. EFI machines support only GRUB2, so I can't boot GRUB4DOS straight away. Please, don't suggest anything like this, because my image doesn't have kernel. You can imagine that you load HDAT2 or Hiren's boot cd, for example. menuentry "Blancco Blancco5.iso" { set isofile="/image.iso" loopback loop $isofile set root=(loop) linux /isolinux/vmlinuz isofile=$isofile splash quiet initrd /isolinux/initrd }

    Read the article

  • Fastest light-weight image viewer over forwarded x11 session (linux)

    - by Matthew
    I have a slow network connection over which I'm forwarding x11 over ssh. I want to view images on the remote host (Ubuntu) quickly and efficiently. I'm looking for an image viewer that will take into account the image viewer window's resolution and downsize the image before sending it over the network, instead of sending the full size image. The images I want to view will be around 5MB and I only need to be able to browse through tiny thumbnails of the images to identify the image I'm looking for. It is not necessary to be able to see more than one image at a time. Highest speed over slow network connection is the priority. Thanks! Matthew EDIT: It's possible that the way x11 forwarding works, only the image at the display resolution will be transferred anyway. If that's true, please confirm and the question still stands for which image viewer will be the fastest over a slow connection

    Read the article

  • Can an image based backup potentially corrupt data?

    - by ServerAdminGuy45
    I'm considering doing image based backups (Acronis) on production Windows systems during non-peak hours. I'm just wondering if they can potentially lead to application data corruption. Lets say that I have a database that is getting hit pretty hard. Could I potentially have the beginning blocks of the database be commit ed to the image, data inserted into the db (which changes the beginning blocks of the DB on the server but not the image), then the blocks of data committed to the image (leading to an inconsistent state). Here's an example of what I'm trying to illustrate. Imagine a simple data structure which has a number in the front which represents the number of "a"s in a file. The number and data are delimited by a "-". For example: 4-ajjjjjjjajuuuuuuuaoffffa If an "a" is changed, the datastructure resets the number in the begining of the file such as: 3-ajjjjjjjajuuuuuuuboffffa I assume acronis writes block by block being a straight up image so here is what i'm invisioning happening with my database t0: 4-ajjjjjjjajuuuuuuuaoffffa ^pointer is here t1: 4-ajjjjjjjajuuuuuuuaoffffa ^pointer is here (all data before this is comitted to the image) t2: 4-ajjjjjjjajuuuuuuuboffffa ^pointer is here (all data before this is comitted to the image) Also notice how one of the "a"s change to a b. There are only 3 "a"s now t3: 4-ajjjjjjjajuuuuuuuboffffa ^pointer is here (all data before this is comitted to the image) The final image now reads "4-ajjjjjjjajuuuuuuuboffffa", while the true data is "3-ajjjjjjjajuuuuuuuboffffa" leading to a corrupt "database". Basically changes further down the blockchain could be reflected in the image, while important header and synchronization could already be committed. The out of date header information doesn't accurately reflect the structure of the blocks to come.

    Read the article

  • data maintenance/migrations in image based sytems

    - by User
    Web applications usually have a database. The code and the database work hand in hand together. Therefore Frameworks like Ruby on Rails and Django create migration files Sure there are also servers written in Self or Smalltalk or other image-based systems that face the same problem: Code is not written on the server but in a separate image of the programmer. How do these systems deal with a changing schema, changing classes/prototypes. Which way do the migrations go? Example: What is the process of a new attribute going from programmer's idea to the server code and all objects? I found the Gemstone/S manual chapter 8 but it does not really talk about the process of shipping code to the server.

    Read the article

  • Image editor component in Flex / JavaScript

    - by nobby
    Hi everyone, I'm looking for a simple Flex or JavaScript based image editing component which can be embedded in a web application. It shouldn't be a web service but rather a component that I can download and customize (i18n etc.). I only need some basic features: most important is cropping, optional features would be rotating and adjusting brightness/contrast. Basically something like splashup.com, but as an open source application rather than a web-service. Thanks a lot in advance for any hints! -- Andreas

    Read the article

  • Finding a simple object in a low-quality image

    - by Ramon Snir
    Hi, I want to do this thing in C# (or any other .NET language), not sure how: I have an image I captured from webcam and I want to find a specific simple object in it (let's say a red circle with a black square in it). The red circle can be a bit different from time to time (because of shadows) and the square might be also a bit brighter sometimes and even rotated a bit. Please help me!

    Read the article

  • java UnsatisfiedLinkError awt.image

    - by Allen
    I have a program that makes use of the following method to get a scaled instance of an image icon: public ImageIcon createScaledImageIcon(String filename) { ImageIcon icon = new ImageIcon(filename); Image image = icon.getImage().getScaledInstance(cardWidth, cardHeight, Image.SCALE_SMOOTH); icon.setImage(image); return icon; } I don't know if it's the source of the problem or not. But i get the following error messages: Exception in thread "Image Fetcher 0" java.lang.UnsatisfiedLinkError: sun.awt.image.ImageRepresentation.setBytePixels(IIII[BIILsun/awt/image/ByteComponentRaster;I)V at sun.awt.image.ImageRepresentation.setBytePixels(Native Method) at sun.awt.image.ImageRepresenation.setPixels(Unknown Source) at sun.awt.image.ImageDecoder.setPixels(Unknown Source) at sun.awt.image.GIFImageDecoder.sendPixels(Unknown Source) ... Let me know if there is any other information I could include that might be of use.

    Read the article

  • background image shows up on right-click show image, but not on webpage

    - by William
    okay, so I'm trying to set up a webpage with a div wrapping two other divs, and the wrapper div has a background, and the other two are transparent. How come this isn't working? here is the CSS: .posttext{ float: left; width: 70%; text-align: left; padding: 5px; background-color: transparent !important; } .postavi{ float: left; width: 100px; height: 100%; text-align: left; background-color: transparent !important; padding: 5px; } .postwrapper{ background-image:url('images/post_bg.png'); background-position:left top; background-repeat:repeat-y; } and here is the HTML: <div class="postwrapper"> <div class="postavi"><img src="http://prime.programming-designs.com/test_forum/images/avatars/hacker.png" alt="hacker"/></div><div class="posttext"><p style="color: #ff0066">You will have bad luck today.</p>lol</div> </div> Edit: at request, here is a link to the site: http://prime.programming-designs.com/test_forum/viewthread.php?thread=33 Edit: edited css to be correct, still suffering same problem

    Read the article

  • ???Past Image(pi)

    - by todd.bao(at)oracle.com
    Past Image???RAC??????????,????????????????????????????????,Past Image??????????,?????????????????,?????????????????,??????????????(pi)?????????????????Past Image,????????????:HR.EMPLOYEES??100????101?????5????88???????????????,???????????# ??1: ?????????SYS@RAC1//scripts> select inst_id,status from gv$bh where file#=5 and block#=88;no rows selected# ??1???(???Steve King, ????24000????)SYS@RAC1//scripts> update hr.employees set salary=1 where employee_id=100;1 row updated.# ??2: ????1??xcur????????????,?????????SYS@RAC1//scripts> select inst_id,dirty,status from gv$bh where file#=5 and  block#=88;   INST_ID + D + STATUS---------- + - + -------         1 + Y + xcur1 row selected.# ??2???SYS@RAC2//scripts> update hr.employees set salary=2 where employee_id=101;1 row updated.# ??3: ????2?,?????1??pi??Past Image,???????????????????????SYS@RAC1//scripts> select inst_id,dirty,status from gv$bh where file#=5 and  block#=88;   INST_ID + D + STATUS---------- + - + -------         1 + Y + pi         2 + Y + xcur2 rows selected.# ??1???SYS@RAC1//scripts> update hr.employees set salary=3 where employee_id=100;1 row updated.# ??4: ????1?,?????2???1???????2???????1???????SYS@RAC1//scripts> select inst_id,dirty,status from gv$bh where file#=5 and  block#=88;   INST_ID + D + STATUS---------- + - + -------         1 + Y + pi         1 + Y + xcur         2 + Y + pi3 rows selected.# ??2????SYS@RAC2//scripts> update hr.employees set salary=4 where employee_id=101;1 row updated.# ??5: ????2?,??????????????,DBWR??,??????,??(pi)?????????????(cr)??????????????????????????SYS@RAC1//scripts> select inst_id,dirty,status from gv$bh where file#=5 and  block#=88;   INST_ID + D + STATUS---------- + - + -------         1 + N + cr         1 + N + cr         2 + Y + xcur3 rows selected.# ?????1???SYS@RAC1//scripts> update hr.employees set salary=5 where employee_id=100;1 row updated.# ??6: ????1?,?????2????????????????,?????????SYS@RAC1//scripts> select inst_id,dirty,status from gv$bh where file#=5 and  block#=88;   INST_ID + D + STATUS---------- + - + -------         1 + Y + xcur         1 + N + cr         1 + N + cr         2 + Y + pi4 rows selected.# ??2???SYS@RAC2//scripts> update hr.employees set salary=6 where employee_id=101;1 row updated.# ??7: ????2?,?????1?2????1???????2?????????????4,????????????????SYS@RAC1//scripts> select inst_id,dirty,status from gv$bh where file#=5 and  block#=88;   INST_ID + D + STATUS---------- + - + -------         1 + Y + pi         2 + Y + pi         2 + Y + xcur3 rows selected.# ??1???SYS@RAC1//scripts> update hr.employees set salary=7 where employee_id=100;1 row updated.# ??8: ????1?,?????2?1????2???????1????????????2????????????????????????????????????(????????)????SYS@RAC1//scripts> select inst_id,dirty,status from gv$bh where file#=5 and  block#=88;   INST_ID + D + STATUS---------- + - + -------         1 + Y + pi         1 + Y + xcur         2 + Y + pi         2 + N + cr4 rows selected.??????????, ?xcur??????????:??????xcur????pi?????pi?(?????)???cr?,???cr?????,pi????????????????????????????:?????????????A?B?A:SYS@RAC1//scripts> run  1  begin  2  for i in 1..100000 loop  3  update hr.employees set salary=i where employee_id=100;  4  end loop;  5* end;B:SYS@RAC2//scripts> run  1  begin  2  for i in 1..100000 loop  3  update hr.employees set salary=i where employee_id=101;  4  end loop;  5* end;?????????,???5???88?????buffer cache???????:SYS@RAC2//scripts> select count(*) from gv$bh where file#=5 and block#=88;  COUNT(*)----------       4121 row selected.??409?????????(cur):SYS@RAC2//scripts> select count(*) from gv$bh where file#=5 and block#=88 where status='cr';  COUNT(*)----------       4091 row selected.1????????(xcur):SYS@RAC2//scripts> select count(*) from gv$bh where file#=5 and block#=88 where status='xcur';  COUNT(*)----------           11 row selected.??...2??????--????(pi)??????????SYS@RAC1//scripts> select inst_id,dirty,status from gv$bh where file#=5 and block#=88 and status='pi';   INST_ID + D + STATUS---------- + - + -------         1 + Y + pi         2 + Y + pi2 rows selected.????,???RAC??????????????(cr)?,????????????????????????xcur?pi??cr??????pi?????? ?????????,???????????pi???cr?,?????????cr???,???xcur???????,pi??????xcur?,[email protected]

    Read the article

  • image scaling with C

    - by sa125
    Hi - I'm trying to read an image file and scale it by multiplying each byte by a scale its pixel levels by some absolute factor. I'm not sure I'm doing it right, though - void scale_file(char *infile, char *outfile, float scale) { // open files for reading FILE *infile_p = fopen(infile, 'r'); FILE *outfile_p = fopen(outfile, 'w'); // init data holders char *data; char *scaled_data; // read each byte, scale and write back while ( fread(&data, 1, 1, infile_p) != EOF ) { *scaled_data = (*data) * scale; fwrite(&scaled_data, 1, 1, outfile); } // close files fclose(infile_p); fclose(outfile_p); } What gets me is how to do each byte multiplication (scale is 0-1.0 float) - I'm pretty sure I'm either reading it wrong or missing something big. Also, data is assumed to be unsigned (0-255). Please don't judge my poor code :) thanks

    Read the article

  • jQuery: How to smooth animated image resizing

    - by nikibrown
    I'm a jQuery noob - so please excuse the probable basicness of this question. I'm doing something pretty simple - on hover animate the position and size of an image. When you mouse over the images there are some noticeable 'jaggies' - is there a way to get rid of this? The jquery code is as follows and a live link is here kristechdev.metropoliscreative.com (hover over the icons). <script type="text/javascript"> $(document).ready(function() { $('#zoomNav li img').hoverIntent( function() { $(this).animate({'margin-top' :'-35px', 'margin-left' :'-10px', 'height' :'95px','width' : '79px' }, 'fast'); }, function() { $(this).animate({'margin-top' : '0px', 'margin-left' :'0px', 'height' :'70px','width' : '58px' }, 'fast'); }); }); </script>

    Read the article

  • What should filenames and URLs of images contain for SEO benefit?

    - by Baumr
    We know that good site architecture usually looks like this: example-company.com/ example-company.com/about/ example-company.com/contact/ example-company.com/products/ example-company.com/products/category/ example-company.com/products/category/productname/ Now, when it comes to Google Image search, it is clear that the img alt tag, filename/URL, and surrounding text (captions, headings, paragraphs) have an effect on ranking. I want to ask about the filename of the images that we should use (e.g. product-photo.jpg). ...but first about the URL: Often web developers stick all images in a single folder in the root: example-company.com/img/ — and I have stopped doing that. (I don't want to get into it, but basically, it seems more semantic for images which make up part of the content at each sub-directory) However, when all images appear in a folder, I feel that their filename needs to reflect what they are a bit more than usual, for example: example-company.com/img/example-company-productname-category.jpg It's a longer filename than just product.png, but as long as it's relevant, I see no problem with regards to SEO (unless you're keyword stuffing), and it could even help rank for keywords: "example company" "productname" "category" So no questions there. But what about when we have places images in the site architecture we outlined at the beginning? In other words, what if image URL paths look like this: example-company.com/products/category/productname/productname.jpg My question is, should the URL be kept short like above and only have the "productname" (and some descriptive keywords) as part of it's filename? Or, should it also include the "example-company" and "category"? Like so: example-company.com/products/category/productname/example-company-category-productname.jpg That seems much longer, and redundant when we look at the URL, but here are a few considerations. Images are often downloaded onto computers, and, to the average user, they lose their original URL and thus — it isn't clear where they came from. Also, some social networks, forums, and other platforms leave the filename intact when uploaded. (Many others rewrite it, for example, Pinterest and Facebook.) Another consideration, will this really help (even if ever so slightly) rank in Google Image Search, or at least inform Google that the product is something specific to the "example-company"? For example, what if this product can only be bought at this store and is the flagship product? In addition to an abundance of internal links to this product page, would having the "example company" name and "category" help it appear in "example company" searches? In other words, is less more?

    Read the article

  • 2D Image Creator for a video game

    - by user1276078
    I need to make a few images for an arcade video game I'm making in Java. As of right now, I have drawings that animate, but there are two problems. The drawings are horrible, and as a result, the game won't get enough attention. It's a pain to have to change each coordinate for the drawing, as the drawings are fairly complex. I'd like to use images. I feel they could solve my problem. They would look better than the drawings, and it would only have an x and a y coordinate, rather than the many coordinates I need for each drawing. So, in a sense, I have two questions. Would images actually help? Would they solve my 2 problems? I just want to clarify. How would I make these images. I don't think I can copy them off of the internet because I plan on publishing this game. So, is there any software where you can make your own images? (It has to be in an image type that Java can support. I'm working with java). It also, as stated by the header, needs to be a 2D image; not 3D

    Read the article

  • Resize image on upload php

    - by blasteralfred
    Hi, I have a php script for image upload as below <?php $LibID = $_POST[name]; define ("MAX_SIZE","10000"); function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } $errors=0; $image=$_FILES['image']['name']; if ($image) { $filename = stripslashes($_FILES['image']['name']); $extension = getExtension($filename); $extension = strtolower($extension); if (($extension != "jpg") && ($extension != "jpeg")) { echo '<h1>Unknown extension!</h1>'; $errors=1; exit(); } else { $size=filesize($_FILES['image']['tmp_name']); if ($size > MAX_SIZE*1024) { echo '<h1>You have exceeded the size limit!</h1>'; $errors=1; exit(); } $image_name=$LibID.'.'.$extension; $newname="uimages/".$image_name; $copied = copy($_FILES['image']['tmp_name'], $newname); if (!$copied) { echo '<h1>image upload unsuccessfull!</h1>'; $errors=1; exit(); }}} ?> which uploads the image file to a folder "uimages" in the root. I have made changes in the html file for the compact display of the image by defining "max-height" and "max-width". But i want to resize the image file on upload. The image file may have a maximum width of 100px and maximum height of 150px. The image proportions must be constrained. That is, the image may be smaller than the above dimensions, but, it should not exceed the limit. How can I make this possible?? Thanks in advance :) blasteralfred..

    Read the article

  • Using R in Processing through rJava/JRI?

    - by tommy-o-dell
    Hi guys, Is it possible to run R in Processing through rJava/JRI? If I deployed a Processing app on the web, would the client need R on their system? I'm looking to create an interactive information dashboard that I can deploy on the web. It seems that Processing is probably my best bet for the interactive/web part of things. Unfortunately, it doesn't look like there are many math/stats functions built-in. And there aren't any libraries for plotting data either. I've been using R and gpplot2 for a few months and am thrilled (amazed) at how easily it manipulates and plots data. So I'm wondering now if can get the best of both worlds and run R through a Processing applet. From the JRI website: JRI is a Java/R Interface, which allows to run R inside Java applications as a single thread. Basically it loads R dynamic library into Java and provides a Java API to R functionality. It supports both simple calls to R functions and a full running REPL. In a sense JRI is the inverse of rJava and both can be combined (i.e. you can run R code inside JRI that calls back to the JVM via rJava). The JGR project makes the full use of both JRI and rJava to provide a full Java GUI for R. JRI uses native code, but it supports all platforms where Sun's Java (or compatible) is available, including Windows, Mac OS X, Sun and Linux (both 32-bit and 64-bit). Thanks for the advice :)

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >