House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

Issues with ImageDrawPoint()

Author:
Jayesh Viradiya
12/01/2008 01:41 AM

Are you saying that Though you are writing the next pixel at the same coordinates as the previous point, it is being written to the right side of the previous pixel ? I tried the following code where I have ImageDrawPoint() twice on the same coordinates and in the final Image I see only one pixel written. So this seems to be working fine on Windows OS. Let me know your configuration details, If I have understood your question right. Jayesh Viradiya Adobe CF Team <cfset myImage=ImageNew("",200,200)> <cfset attr = StructNew()> <cfset attr.width = 10> <cfset ImageSetDrawingStroke(myImage,attr)> <!--- Draw the point at (100,100). ---> <cfset ImageDrawPoint(myImage,100,100)> <cfset ImageDrawPoint(myImage,100,100)> <!--- Display the image in a browser. ---> <cfimage source="#myImage#" action="write" destination="C:\ColdFusionCentaur\wwwroot\point.jpg" overwrite="yes"> <img src="point.jpg"> Good afternoon everyone. Over thanksgiving I was intrigued by the image functions that CF8 has to offer.  So I did a little experimentation project.  For the the most part, they are terrific! In fact, there is really only one issue I have with the functionality. I did a little demo of the ImageDrawPoint function; basically it's just filling up an a new image with random hex pixels.  The program works it's wonders.  However, I noticed when I just write a single pixel (let's say in the middle of an image) it cannibalizes the next pixel to the right of the one I wrote to and changes it to the same color as the pixel written to. I emphasize the pixel to the right! When writing to a pixel that is at the right-most edge, the problem doesn't happen (seems obvious because there is no pixel to the right).  I've tried multiple scenarios such as writing to a new image using ImageNew, uploading an existing image and writing to that, and I've tried saving to multiple file formats (png, gif, tiff, jpg, etc).  All have the same problem.  I have anti-aliasing off.  Now this issue may have to do with the imageWrite and the algorithms it uses to save the image. Is there a lossless format to save in (I thought tiff was lossless)?  I'm not an image format junkie so a little help would be appreciated on that end. Has anyone else come across this problem?  I have some code upon request to show you the method I used and what other lurking variables may exist in my code. Thanks to all in advance! (Sorry if this is a repost... Fusion rejected it because I wasn't subscribed to the list, oops)


Search cf-talk

March 18, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31