Search Results

Search found 19460 results on 779 pages for 'image transparency'.

Page 1/779 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • My PNG has transparency, but after saving with PHP GD, transparency is lost [closed]

    - by Harry Stroker
    I found the solution to my problem. See below the original post and completely at the bottom my solution. I made a stupid mistake :) First I crop an image and then save it to a png file. Right after this, I also show the image. However, the saved png does not have transparency and the shown one has. What is going on? $this->resource = imagecreatefrompng($this->url); imagealphablending($this->resource, false); imagesavealpha($this->resource, true); $newResource = imagecreatetruecolor($destWidth, $destHeight); imagealphablending($newResource, false); imagesavealpha($newResource, true); $resample = imagecopyresampled($newResource,$this->resource,0,0,$srcX1,$srcY1,$destWidth,$destHeight,$srcX2-$srcX1, $srcY2-$srcY1); imagedestroy($this->resource); $this->resource = $newResource; // SAVING imagepng($this->resource, $destination, 100); // SHOWING header('Content-type: image/png'); imagepng($this->resource); The reason I also save the image is for caching. If the script is executed on a png, it saves a cached png. Next time the image is requested, the png file will be shown, but it has lost its transparency. Even stranger: When I save that cached png image as (within Firefox), it saves it suddenly as a jpg, even though the extension was png. Downloading the cached png using chrome and opening it in Photoshop gives the error: "file-format module cannot parse the file". I will show you the shown PNG and the generated PNG: http://www.foodmuseum.nl/SaveProblemTransparency.png Once I try to show that saved PNG with the GD library, it gives me an error. EDIT NO NO NO NO THIS IS NOT A DUPLICATE!!!... I ALREADY USED THEIR SOLUTION. The solution in the supposedly duplicate works for showing my image. But I also try to save it with the exact same resource, but then it has no transparency. EDIT 2 - SOLUTION I found out what the problem was. It was a stupid mistake. The script I provided above were cut out of a class and placed as sequential code, while in real this is not what exactly happened. The save image function: function saveImage($destination,$quality = 90) { $this->loadResource(); switch($extension){ default: case 'JPG': case 'jpg': imagejpeg($this->resource, $destination, $quality); break; case 'gif': imagegif($this->resource, $destination); break; case 'png': imagepng($this->resource, $destination); break; case 'gd2': imagegd2($this->resource, $destination); break; } } However... $extension does not exist. I fixed it by adding: $extension = $this->getExtension($destination);

    Read the article

  • Lost transparency in SDL surfaces drawn manually

    - by Christian Ivicevic
    I want to create SDL_Surface objects for each layer of my 2d tile-based map so that I have to render only one surface per layer rather than too many tiles. With normal tiles which do not have transparent areas this works well, however I am not able to create a SDL_Surface with transparent pixels everywhere to be able to draw some tiles on specific parts which should be visible (I do NOT want the whole surface to appear with a specific opacity - I want to create overlaying tiles where one can look through). Currently I am creating my layers like this to draw with SDL_BlitSurface on them: SDL_Surface* layer = SDL_CreateRGBSurface( SDL_HWSURFACE | SDL_SRCALPHA, layerWidth, layerHeight, 32, 0, 0, 0, 0); If you have a look at this screenshot I have provided here you can see that the bottom layer with no transparent parts gets rendered correctly. However the overlay with the tree tile (which is transparent in the top left corner) is drawn own its own surface which is black and not transparent as expected. The expected result (concerning the transparency) can be seen here Can anyone explain me how to handle surfaces which are actually transparent rather than drawing all my overlay tiles separately?

    Read the article

  • GIMP: change the exact color on the image - OK, but transparency disappears

    - by Haradzieniec
    There is no problem for me now to change color for pixels of the same color: I click on "Select by Color Tool"(Ctrl+O). The pixels of the same color are selected now. Then I press Ctrl+,. The selected pixels are white now (the white color is taken from a foreground color). The problem is the transparency. The green color I want to change to the white one has transparency. Once I use my method, the transparency disappears so all my-green-color with any transparency becomes white and without transparency. How do I keep the transparency by using my method? My picture is in .png format.

    Read the article

  • Transparency and AlphaBlending

    - by TechTwaddle
    In this post we'll look at the AlphaBlend() api and how it can be used for semi-transparent blitting. AlphaBlend() takes a source device context and a destination device context (DC) and combines the bits in such a way that it gives a transparent effect. Follow the links for the msdn documentation. So lets take a image like, and AlphaBlend() it on our window. The code to do so is below, (under the WM_PAINT message of WndProc) HBITMAP hBitmap=NULL, hBitmapOld=NULL; HDC hMemDC=NULL; BLENDFUNCTION bf; hdc = BeginPaint(hWnd, &ps); hMemDC = CreateCompatibleDC(hdc); hBitmap = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_BITMAP1)); hBitmapOld = SelectObject(hMemDC, hBitmap); bf.BlendOp = AC_SRC_OVER; bf.BlendFlags = 0; bf.SourceConstantAlpha = 80; //transparency value between 0-255 bf.AlphaFormat = 0;    AlphaBlend(hdc, 0, 25, 240, 100, hMemDC, 0, 0, 240, 100, bf); SelectObject(hMemDC, hBitmapOld); DeleteDC(hMemDC); DeleteObject(hBitmap); EndPaint(hWnd, &ps);   The code above creates a memory DC (hMemDC) using CreateCompatibleDC(), loads a bitmap onto the memory DC and AlphaBlends it on the device DC (hdc), with a transparency value of 80. The result is: Pretty simple till now. Now lets try to do something a little more exciting. Lets get two images involved, each overlapping the other, giving a better demonstration of transparency. I am also going to add a few buttons so that the user can increase or decrease the transparency by clicking on the buttons. Since this is the first time I played around with GDI apis, I ran into something that everybody runs into sometime or the other, flickering. When clicking the buttons the images would flicker a lot, I figured out why and used something called double buffering to avoid flickering. We will look at both my first implementation and the second implementation just to give the concept a little more depth and perspective. A few pre-conditions before I dive into the code: - hBitmap and hBitmap2 are handles to the two images obtained using LoadBitmap(), these variables are global and are initialized under WM_CREATE - The two buttons in the application are labeled Opaque++ (make more opaque, less transparent) and Opaque-- (make less opaque, more transparent) - DrawPics(HWND hWnd, int step=0); is the function called to draw the images on the screen. This is called from under WM_PAINT and also when the buttons are clicked. When Opaque++ is clicked the 'step' value passed to DrawPics() is +20 and when Opaque-- is clicked the 'step' value is -20. The default value of 'step' is 0 Now lets take a look at my first implementation: //this funciton causes flicker, cos it draws directly to screen several times void DrawPics(HWND hWnd, int step) {     HDC hdc=NULL, hMemDC=NULL;     BLENDFUNCTION bf;     static UINT32 transparency = 100;     //no point in drawing when transparency is 0 and user clicks Opaque--     if (transparency == 0 && step < 0)         return;     //no point in drawing when transparency is 240 (opaque) and user clicks Opaque++     if (transparency == 240 && step > 0)         return;         hdc = GetDC(hWnd);     if (!hdc)         return;     //create a memory DC     hMemDC = CreateCompatibleDC(hdc);     if (!hMemDC)     {         ReleaseDC(hWnd, hdc);         return;     }     //while increasing transparency, clear the contents of screen     if (step < 0)     {         RECT rect = {0, 0, 240, 200};         FillRect(hdc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));     }     SelectObject(hMemDC, hBitmap2);     BitBlt(hdc, 0, 25, 240, 100, hMemDC, 0, 0, SRCCOPY);         SelectObject(hMemDC, hBitmap);     transparency += step;     if (transparency >= 240)         transparency = 240;     if (transparency <= 0)         transparency = 0;     bf.BlendOp = AC_SRC_OVER;     bf.BlendFlags = 0;     bf.SourceConstantAlpha = transparency;     bf.AlphaFormat = 0;            AlphaBlend(hdc, 0, 75, 240, 100, hMemDC, 0, 0, 240, 100, bf);     DeleteDC(hMemDC);     ReleaseDC(hWnd, hdc); }   In the code above, we first get the window DC using GetDC() and create a memory DC using CreateCompatibleDC(). Then we select hBitmap2 onto the memory DC and Blt it on the window DC (hdc). Next, we select the other image, hBitmap, onto memory DC and AlphaBlend() it over window DC. As I told you before, this implementation causes flickering because it draws directly on the screen (hdc) several times. The video below shows what happens when the buttons were clicked rapidly: Well, the video recording tool I use captures only 15 frames per second and so the flickering is not visible in the video. So you're gonna have to trust me on this, it flickers (; To solve this problem we make sure that the drawing to the screen happens only once and to do that we create an additional memory DC, hTempDC. We perform all our drawing on this memory DC and finally when it is ready we Blt hTempDC on hdc, and the images are displayed in one go. Here is the code for our new DrawPics() function: //no flicker void DrawPics(HWND hWnd, int step) {     HDC hdc=NULL, hMemDC=NULL, hTempDC=NULL;     BLENDFUNCTION bf;     HBITMAP hBitmapTemp=NULL, hBitmapOld=NULL;     static UINT32 transparency = 100;     //no point in drawing when transparency is 0 and user clicks Opaque--     if (transparency == 0 && step < 0)         return;     //no point in drawing when transparency is 240 (opaque) and user clicks Opaque++     if (transparency == 240 && step > 0)         return;         hdc = GetDC(hWnd);     if (!hdc)         return;     hMemDC = CreateCompatibleDC(hdc);     hTempDC = CreateCompatibleDC(hdc);     hBitmapTemp = CreateCompatibleBitmap(hdc, 240, 150);     hBitmapOld = (HBITMAP)SelectObject(hTempDC, hBitmapTemp);     if (!hMemDC)     {         ReleaseDC(hWnd, hdc);         return;     }     //while increasing transparency, clear the contents     if (step < 0)     {         RECT rect = {0, 0, 240, 150};         FillRect(hTempDC, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));     }     SelectObject(hMemDC, hBitmap2);     //Blt hBitmap2 directly to hTempDC     BitBlt(hTempDC, 0, 0, 240, 100, hMemDC, 0, 0, SRCCOPY);         SelectObject(hMemDC, hBitmap);     transparency += step;     if (transparency >= 240)         transparency = 240;     if (transparency <= 0)         transparency = 0;     bf.BlendOp = AC_SRC_OVER;     bf.BlendFlags = 0;     bf.SourceConstantAlpha = transparency;     bf.AlphaFormat = 0;            AlphaBlend(hTempDC, 0, 50, 240, 100, hMemDC, 0, 0, 240, 100, bf);     //now hTempDC is ready, blt it directly on hdc     BitBlt(hdc, 0, 25, 240, 150, hTempDC, 0, 0, SRCCOPY);     SelectObject(hTempDC, hBitmapOld);     DeleteObject(hBitmapTemp);     DeleteDC(hMemDC);     DeleteDC(hTempDC);     ReleaseDC(hWnd, hdc); }   This function is very similar to the first version, except for the use of hTempDC. Another point to note is the use of CreateCompatibleBitmap(). When a memory device context is created using CreateCompatibleDC(), the context is exactly one monochrome pixel high and one monochrome pixel wide. So in order for us to draw anything onto hTempDC, we first have to set a bitmap on it. We use CreateCompatibleBitmap() to create a bitmap of required dimension (240x150 above), and then select this bitmap onto hTempDC. Think of it as utilizing an extra canvas, drawing everything on the canvas and finally transferring the contents to the display in one scoop. And with this version the flickering is gone, video follows:   If you want the entire solutions source code then leave a message, I will share the code over SkyDrive.

    Read the article

  • 1st Issue of GIMP Magazine now Available [Free Download]

    - by Asian Angel
    Are you ready for an awesome (and free) magazine that is all about GIMP? Then GIMP Magazine is the publication that you have been looking for! This free quarterly magazine focuses on photography, digital arts, tips and tricks, step by step tutorials, master classes, help desk questions, and so much more. You can access the 1st issue in three ways: As a direct PDF download As a Bit-Torrent download View it online at Issuu Choose the option that works best for you! Note: The PDF file is 47.1 MB in size. A sample page from the magazine for your viewing pleasure… HTG Explains: Is ReadyBoost Worth Using? HTG Explains: What The Windows Event Viewer Is and How You Can Use It HTG Explains: How Windows Uses The Task Scheduler for System Tasks

    Read the article

  • Pygame set_colorkey transparency issues

    - by Nathan Chowning
    I'm having a strange issue that I cannot seem to remedy. I am doing some prototyping with Pygame on a desktop running windows and a laptop running OS X. Both are running python v2.7.3 (installed via homebrew for the Macbook) and pygame v1.9.1. For transparency, I have been using set_colorkey with a transparency color of (255, 0, 255). Here is the applicable code: transColor = pygame.Color(255, 0, 255) image = pygame.image.load(playerPath + "idle.png").convert() image.set_colorkey(transColor) This works flawlessly on my windows machine. On my laptop, it does not work. It just shows the hideous magenta color. Here's the strange part. If I change the transColor to (0, 0, 0), all black pixels in my images are transparent. Has anyone run into this issue before?

    Read the article

  • Drawing Transparency in XNA 4.0

    - by dpaz
    Using C# (VS2010) with XNA 4.0, I have a terrain layer (RenderTarget2D) in a 2D side-scroller. My visual system tracks updates to redraw individual tiles, but I am having trouble finding a way to clear out the rectangle where the tile will be drawn, which I must do because A) there may no longer be a tile or B) the tile may itself contain transparency. How can I draw a rectangle of transparency onto an existing RenderTarget2D? I essentially want to clear just that rectangular portion of it. My Google searches have not yielded anything relevant.

    Read the article

  • Simple image editor to select area of image as wallpaper

    - by Kevin
    I've spent way to many hours looking for software to do the following simple task, so now I'll ask. I need software that will open an image and put a 'crop box' on it. You can set the 'crop box' to standard screen resolutions (1024x768) or define a custom one. You can move the 'crop box' around on the image to select the area you want. You can re-size the 'crop box' (selecting a corner and dragging w/mouse) and it maintains the correct aspect ratio. You can save the area in the 'crop box' to use as the Windows background. (The software doesn't need to set it as the background, I can do that myself in Windows XP.) The free software sites (CNET.com, etc.) have lots of image editing software that do things much more complicated than this simple task. I've spent too many hours downloading them to see if they will do this particular task. The ones I've tried would require manual trial and error to get the part of an image that I want saved as an image, with the correct aspect ratio so Windows doesn't screw with it (stretch, tile, crop) when I select it as the wallpaper.

    Read the article

  • XNA Transparency depending on drawing order?

    - by DarthRoman
    I am drawing two 3D objects, both of them can fade from opaque to transparent independently, and they can intersect between them (so you cannot say when one of them is before the other one). Look at the image for a better understanding (one of the object is a terrain and the other one an area): Now, if I apply transparency to both of them, and draw the terrain before the area, the terrain is not transparent respecting to the area, but the area is: And finally, if I draw the area before the terrain, then the area is not transparent respecting of the terrain: QUESTION: How can I make all the objects transparent to the rest of objects without depending on the drawing order?

    Read the article

  • Ubuntu 12.10 Unity Dash transparency problem

    - by madox2
    I have just upgraded my Ubuntu 12.04 to 12.10 and there is following problem. When I press super button to show Unity Dash I get wrong background image behind the dash box. Especially I can see part of the bottom of the screen. Also when I set transparency to top panel the background behind is not correct. Here is an example with Mc Duck picture: Unity Mc Duck example Do you have any ideas whats wrong? My system preferences: Ubuntu 12.10 32-bit Intel® Pentium(R) CPU G840 @ 2.80GHz × 2 GeForce GTS 450/PCIe/SSE2 Any help will be highly appreciated!

    Read the article

  • OpenCV: Shift/Align face image relative to reference Image (Image Registration)

    - by Abhischek
    I am new to OpenCV2 and working on a project in emotion recognition and would like to align a facial image in relation to a reference facial image. I would like to get the image translation working before moving to rotation. Current idea is to run a search within a limited range on both x and y coordinates and use the sum of squared differences as error metric to select the optimal x/y parameters to align the image. I'm using the OpenCV face_cascade function to detect the face images, all images are resized to a fixed (128x128). Question: Which parameters of the Mat image do I need to modify to shift the image in a positive/negative direction on both x and y axis? I believe setImageROI is no longer supported by Mat datatypes? I have the ROIs for both faces available however I am unsure how to use them. void alignImage(vector<Rect> faceROIstore, vector<Mat> faceIMGstore) { Mat refimg = faceIMGstore[1]; //reference image Mat dispimg = faceIMGstore[52]; // "displaced" version of reference image //Rect refROI = faceROIstore[1]; //Bounding box for face in reference image //Rect dispROI = faceROIstore[52]; //Bounding box for face in displaced image Mat aligned; matchTemplate(dispimg, refimg, aligned, CV_TM_SQDIFF_NORMED); imshow("Aligned image", aligned); } The idea for this approach is based on Image Alignment Tutorial by Richard Szeliski Working on Windows with OpenCV 2.4. Any suggestions are much appreciated.

    Read the article

  • Image Viewer application, Image processing with Display Data.

    - by Harsha
    Hello All, I am working on Image Viewer application and planning to build in WPF. My Image size are usually larger than 3000x3500. After searching for week, I got sample code from MSDN. But it is written in ATL COM. So I am planning to work and build the Image viewer as follows: After reading the Image I will scale down to my viewer size, viwer is around 1000x1000. Lets call this Image Data as Display Data. Once displaying this data, I will work only this Display data. For all Image processing operation, I will use this display data and when user choose to save the image, I will apply all the operation to original Image data. My question is, Is is ok to use Display data for showing and initial image processing operations.

    Read the article

  • Image Viewer application, Image processing with Dispaly Data.

    - by Harsha
    Hello All, I am working on Image Viewer application and planning to build in WPF. My Image size are usually larger than 3000x3500. After searching for week, I got sample code from MSDN. But it is written in ATL COM. So I am planning to work and build the Image viewer as follows: After reading the Image I will scale down to my viewer size, viwer is around 1000x1000. Lets call this Image Data as Display Data. Once displaying this data, I will work only this Display data. For all Image processing operation, I will use this display data and when user choose to save the image, I will apply all the operation to original Image data. My question is, Is is ok to use Display data for showing and initial image processing operations.

    Read the article

  • cocos2d fragment shader transparency

    - by fiddler
    I'm playing with custom fragment shaders for a CCSprite (see http://www.raywenderlich.com/4428/how-to-mask-a-sprite-with-cocos2d-2-0). But I can't figure out why I get a white color whith the following line: gl_FragColor = vec4(1.0,1.0,1.0,0.0); Whereas I have a transparent color with this: gl_FragColor = vec4(0.0,0.0,0.0,0.0); Shouln't I have a transparent sprite in both cases ? (alpha channel is null, right ?)

    Read the article

  • IOS OpenGl transparency performance issue

    - by user346443
    I have built a game in Unity that uses OpenGL ES 1.1 for IOS. I have a nice constant frame rate of 30 until i place a semi transparent texture over the top on my entire scene. I expect the drop in frames is due to the blending overhead with sorting the frame buffer. On 4s and 3gs the frames stay at 30 but on the iPhone 4 the frame rate drops to 15-20. Probably due to the extra pixels in the retina compared to the 3gs and smaller cpu/gpu compared to the 4s. I would like to know if there is anything i can do to try and increase the frame rate when a transparent texture is rendered on top of the entire scene. Please not the the transparent texture overlay is a core part of the game and i can't disable anything else in the scene to speed things up. If its guaranteed to make a difference I guess I can switch to OpenGl ES 2.0 and write the shaders but i would prefer not to as i need to target older devices. I should add that the depth buffer is disabled and I'm blending using SrcAlpha One. Any advice would be highly appreciated. Cheers

    Read the article

  • Mobile 3D engine renders alpha as full-object transparency

    - by Nils Munch
    I am running a iOS project using the isgl3d framework for showing pod files. I have a stylish car with 0.5 alpha windows, that I wish to render on a camera background, seeking some augmented reality goodness. The alpha on the windows looks okay, but when I add the object, I notice that it renders the entire object transparently, where the windows are. Including interior of the car. Like so (in example, keyboard can be seen through the dashboard, seats and so on. should be solid) The car interior is a seperate object with alpha 1.0. I would rather not show a "ghost car" in my project, but I haven't found a way around this. Have anyone encountered the same issue, and eventually reached a solution ?

    Read the article

  • Order independent transparency in particle system

    - by Stepan Zastupov
    I'm writing a particle system and would like to find a trick to achieve proper alpha blending without sorting particles because: Each particle is a point sprite in a single mesh and I can't use scene graph ability to sort transparent nodes. The system node should be properly sorted, though. Particle position is computed on shader from initial velocity, acceleration and time. In order to sort the system I would have to perform all this computations on CPU, which is something I want to avoid. Sorting hundreds of particles against camera position and uploading it on GPU each frame seams to be quiet heavy operation. Alpha testing seems to be fast enough on GLES 2.0 and works fine for non-transparent but "masked" textures. Still, it's not enough for semi-transparent particles. How would you handle this?

    Read the article

  • image archive VS image strip

    - by DevA
    Hi, i've noticed that plenty of games / applications (very common on mobile builds) pack numerous images into an image strip. I figured that the advantages in this are making the program more tidy (file system - wise) and reducing (un)installation time. During the runtime of the application, the entire image strip is allocated and copied from FS to RAM. On the contrary, images can be stored in an image archive and unpacked during runtime to a number of image structures in RAM. The way I see it, the image strip approach is less efficient because of worse caching performance and because that even if the optimal rectangle packing algorithm is used, there will be empty spaces between the stored images in the strip, causing a waste of RAM. What are the advantages in using an image strip over using an image archive file?

    Read the article

  • Recognize objects in image

    - by DoomStone
    Hello I am in the process of doing a school project, where we have a robot driving on the ground in between Flamingo plates. We need to create an algorithm that can identify the locations of these plates, so we can create paths around them (We are using A Star for that). So far have we worked with AForged Library and we have created the following class, the only problem with this is that when it create the rectangles dose it not take in account that the plates are not always parallel with the camera border, and it that case will it just create a rectangle that cover the whole plate. So we need to some way find the rotation on the object, or another way to identify this. I have create an image that might help explain this Image the describe the problem: http://img683.imageshack.us/img683/9835/imagerectangle.png Any help on how I can do this would be greatly appreciated. Any other information or ideers are always welcome. public class PasteMap { private Bitmap image; private Bitmap processedImage; private Rectangle[] rectangels; public void initialize(Bitmap image) { this.image = image; } public void process() { processedImage = image; processedImage = applyFilters(processedImage); processedImage = filterWhite(processedImage); rectangels = extractRectangles(processedImage); //rectangels = filterRectangles(rectangels); processedImage = drawRectangelsToImage(processedImage, rectangels); } public Bitmap getProcessedImage { get { return processedImage; } } public Rectangle[] getRectangles { get { return rectangels; } } private Bitmap applyFilters(Bitmap image) { image = new ContrastCorrection(2).Apply(image); image = new GaussianBlur(10, 10).Apply(image); return image; } private Bitmap filterWhite(Bitmap image) { Bitmap test = new Bitmap(image.Width, image.Height); for (int width = 0; width < image.Width; width++) { for (int height = 0; height < image.Height; height++) { if (image.GetPixel(width, height).R > 200 && image.GetPixel(width, height).G > 200 && image.GetPixel(width, height).B > 200) { test.SetPixel(width, height, Color.White); } else test.SetPixel(width, height, Color.Black); } } return test; } private Rectangle[] extractRectangles(Bitmap image) { BlobCounter bc = new BlobCounter(); bc.FilterBlobs = true; bc.MinWidth = 5; bc.MinHeight = 5; // process binary image bc.ProcessImage( image ); Blob[] blobs = bc.GetObjects(image, false); // process blobs List<Rectangle> rects = new List<Rectangle>(); foreach (Blob blob in blobs) { if (blob.Area > 1000) { rects.Add(blob.Rectangle); } } return rects.ToArray(); } private Rectangle[] filterRectangles(Rectangle[] rects) { List<Rectangle> Rectangles = new List<Rectangle>(); foreach (Rectangle rect in rects) { if (rect.Width > 75 && rect.Height > 75) Rectangles.Add(rect); } return Rectangles.ToArray(); } private Bitmap drawRectangelsToImage(Bitmap image, Rectangle[] rects) { BitmapData data = image.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); foreach (Rectangle rect in rects) Drawing.FillRectangle(data, rect, Color.Red); image.UnlockBits(data); return image; } }

    Read the article

  • Where can I learn image processing? [on hold]

    - by Little Child
    I am learning image processing on my own and I have managed to teach myself a fair few things like: Making images grayscale using 3 different methods Applying a 'pixellate' filter Applying a 'pointillize' filter Make images out of lines Now, I want to take my knowledge further but I do not know how. Adding more information: I am interested in making software like Photoshop or Gimp (although it won't be half as powerful as these 2). So, I want to learn to apply various creative effects to an image. Can someone please suggest resources for this??

    Read the article

  • PHP invalid image's and error handling

    - by Emdiesse
    Using PHP's Image and GD functions you can use the following method to finally output the php image imagepng($image); Sometimes, for whatever reason the image may not be displayed typically the error is not with the image but with the actual php functions not executing successfully. However this causes a blank image to be returned which doesn't help me. What I want to know is, is there a way to detect a blank or an invalid image and create a new image, write the errors to the new image using imagestring() and then display this new (debug) image instead. for example, a successfully displayed image with no errors: $image = imagecreate(256, 256); //create image imagecolortransparent($image, $BLUE); //set transparent imagefilledrectangle($image, 0, 0, 256, 256, $BLUE); //fill with 'transparent colour' //Draw a border round the image imageline($image, 0, 0, 0, 255, $Black); imageline($image, 0, 0, 255, 0, $Black); imageline($image, 255, 0, 255, 255, $Black); imageline($image, 0, 255, 255, 255, $Black); imagestring($image, 1, 10, 10, "I am an image!", $Black); imagepng($image); imagedestroy($image); but if I then introduce some errors in the php script that may or may not be to do with the actual image creation then the php script fails and the image will not be visible... $image = imagecreate(256, 256); //create image imagecolortransparent($image, $BLUE); //set transparent imagefilledrectangle($image, 0, 0, 256, 256, $BLUE); //fill with 'transparent colour' //Draw a border round the image imageline($image, 0, 0, 0, 255, $Black); imageline($image, 0, 0, 255, 0, $Black); imageline($image, 255, 0, 255, 255, $Black); imageline($image, 0, 255, 255, 255, $Black); imagestring($image, 1, 10, 10, "I am an image!", $Black); /* I am here to cause problems with the php script ** and cause the execution to fail, I am a function ** that does't exist... ** ** and I am missing a semi colon! ;)*/ non_existant_function() imagepng($image); imagedestroy($image); At this point I want to create a new image like above but in replacement of the I am an image! text I would put the actual error that has occured.

    Read the article

  • How to set the image into fit screen in the image view

    - by Pugal Devan
    Hi, I am new to iphone development. I want to display the actual size of the image in image view. I have created image view by using Interface builder and set the properties. Now the problem is, I have set into "Scale to Fill", then the image will be stretched in the full screen. Now i want to display the actual size of the image will be displayed in image view. For example 52X52 size image should be displayed with the same size in the image view.The 1200X1020 size image should be fit to the size of the image view .So according the size of the image it should fit to image view and i want the image smaller than image view should retain its original size(It should not stretch to fit the image view). Is it any possible solution to achieve it, please guide me. Thanks.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >