Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to stretch an image in one direction without it fading, but no matter what I try it either fades out or doesnt show at all. Anyone know of a way to stretch an image in one direction without having it fade?



[Update]

Here is a sample code demonstrating what is happening:
http://pastebin.com/f95gYzxt



Here is a sample image to go with the code:
http://imageshack.us/photo/my-images/405/testll.png/


Run the program and you'll see how it fades to where it doesn't even show anymore.
Posted
Updated 14-Nov-11 13:26pm
v4
Comments
Wayne Gaylard 13-Nov-11 2:45am    
What have you tried?
Fox536 13-Nov-11 3:23am    
I've tried drawing the image after setting the interpolation to nearest, I've tried just drawing the image in a picturebox with stretch turned on I've tried the CompositingMode settings and the pixelOffset as well. I've search for over an hour now trying different things but nothing seems to make the image stretch without fade. Any Ideas?
BillWoodruff 13-Nov-11 18:59pm    
What do you mean by "fading" here: do you mean that the pixels are somehow getting "washed out:" or, are you referring to something other than color, like pixels getting 'bigger' ?
Fox536 13-Nov-11 20:08pm    
I mean fading... as in going from an Opaque color (Opacity 255) to a transparent color (Opacity 0). But I've found a cruddy solution, which is to add a paint method then loop through and just repeatedly draw the image. It's not a simple task but it's the only thing that seems to work, as long as you don't need it to redraw or else it takes forever. I need a way to draw to an image thats in memory then if I need to I can stretch it further later, any ideas how?
Sergey Alexandrovich Kryukov 13-Nov-11 21:44pm    
Opacity 0 would make an image invisible. If that what you have? I doubt it. If you do it right there is no "fading"; and I'm not sure that you correctly interpret what you observe as "fading". That said, you need to make a simple code sample which manifest this problem and post it. Use "Improve question" above.
--SA

Hi,

See these link Expando Image script


You may also see my Article
Display/Store and Retrieve Image Data from Database to Gridview, and also on Mouse Over

Hope could help...

Please remember to vote if could help...

Regards,

Al Moje
 
Share this answer
 
v3
Comments
Fox536 14-Nov-11 0:15am    
I'm sorry but that doesn't help for what I need but thanks for trying, I found a solution for the problem.
BillWoodruff 14-Nov-11 7:41am    
Well, Fox536, don't leave us "hanging:" what was the solution you found ?
Fox536 14-Nov-11 19:56pm    
It's a jerry-rig solution to the built-in gaping hole in the way Windows forces forms to work, but basically you have to loop through in whatever direction your going and paint the image to each pixel to keep from fading.

Here is the Jerry-rig Fix
http://pastebin.com/cVaFf6Xq
BillWoodruff 14-Nov-11 23:19pm    
Interesting, but really hard to imagine this "brute force" technique is required. Curious: did you by any chance try a lower bit-size png file, like an 8-bit solid color one ? Perhaps png format is a requirement here ?

best, Bill
Fox536 15-Nov-11 0:33am    
I tried to use, all the png types .Paint allows, jpeg, jpg(I know these 2 should be the same), bitmap, but they all had the same result.
Here is a jerry-rig solution to the built-in gaping hole in the way Windows forces forms to work, but basically you have to loop through in whatever direction your going and paint the image to each pixel to keep from fading.

Here is the Jerry-rig Fix
http://pastebin.com/cVaFf6Xq
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900