Deprecated: Assigning the return value of new by reference is deprecated in /var/www/omflash.dk/public_html/wp-includes/cache.php on line 33

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/omflash.dk/public_html/wp-content/plugins/sem-subscribe-me2/sem-subscribe-me.php on line 511

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_query_vars() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1252

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_posts_where() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1252

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_posts_join() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1252

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_tag_templates() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1329
ActionScript 3: Konverter farvebilleder til sort/hvid - omFlash();
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_add_ajax_javascript() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1329

ActionScript 3: Konverter farvebilleder til sort/hvid


Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/omflash.dk/public_html/wp-includes/functions-formatting.php on line 83

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_the_content_filter() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1252

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /var/www/omflash.dk/public_html/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 638

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /var/www/omflash.dk/public_html/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 638

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /var/www/omflash.dk/public_html/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 639

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /var/www/omflash.dk/public_html/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 639

Strict Standards: Non-static method UltimateTagWarriorActions::replaceTagWithLink() should not be called statically in /var/www/omflash.dk/public_html/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 643

Nogen gange har man brug for det samme billede både i farver og i sort/hvid, men hvorfor bruge tid på at konvertere dem manuelt og ikke mindst, spilde båndbredde på at loade dobbelt så mange billeder, når man kan konvertere dem fra farver til sort/hvid automatisk i ActionScript 3?

Funktion:

function convertToBW(_image:Bitmap):Bitmap {
	var _image_bw:Bitmap = new Bitmap(_image.bitmapData);
	var _r:Rectangle = new Rectangle(0, 0, _image_bw.width, _image_bw.height);
	var _p:Point = new Point(0,0);
	_image_bw.bitmapData.copyChannel(_image_bw.bitmapData, _r, _p, 2, 1);
	_image_bw.bitmapData.copyChannel(_image_bw.bitmapData, _r, _p, 2, 2);
	_image_bw.bitmapData.copyChannel(_image_bw.bitmapData, _r, _p, 2, 4);
	return _image_bw;
}



Del:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg

3 kommentarer

  1. Thonbo siger: (16. august 2008 kl. 09:35 )

    Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/omflash.dk/public_html/wp-includes/functions-formatting.php on line 83

    når det er man benytter flashes egen adjustment filter til et movieclip så tilføjer den faktisk via actionscript et ColorMatrixFilter til dit object - det ser sådan her ud

    var CoMaFilter:ColorMatrixFilter = new ColorMatrixFilter()
    CoMaFilter.matrix = [0.3,0.6,0,0,0,0.3,0.6,0,0,0,0.3,0.6,0,0,0,0,0,0,1,0]
    ///////////
    myImg_mc.filters = [CoMaFilter]

    BANG ! sort hvid filter

  2. Mads Buch Stage siger: (18. august 2008 kl. 10:30 )

    Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/omflash.dk/public_html/wp-includes/functions-formatting.php on line 83

    Tak Thonbo!

    Altid interessant med flere angrebsvinkler på samme problemstilling :-)

  3. ActionScript 3: Picture klasse med indbygget load, brightness, contrast, saturation og hue · omFlash(); siger: (27. august 2008 kl. 13:35 )

    Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/omflash.dk/public_html/wp-includes/functions-formatting.php on line 83

    […] For ikke så lang tid siden havde jeg en post om hvordan man nemt kan konvertere et billede til sort/hvid. I den post kom der en kommentar fra Thonbo som viste en anden måde at gøre det på, nemlig ved hjælp af ColorMatrixFilter, som jeg hidtil har afholdt mig fra at bruge, da det er en anelse tungt at sætte sig ind. […]

Skriv en kommentar