Jump to page: 1 2
Thread overview
Blog Post #0062: Cairo Load & Display Images
Aug 16, 2019
Ron Tarrant
Aug 16, 2019
bauss
Aug 17, 2019
Ron Tarrant
Aug 17, 2019
bauss
Aug 16, 2019
Andre Pany
Aug 17, 2019
Ron Tarrant
Aug 17, 2019
Ron Tarrant
Aug 18, 2019
Andre Pany
Aug 18, 2019
Ron Tarrant
Aug 18, 2019
Andre Pany
Aug 18, 2019
Ron Tarrant
Aug 18, 2019
Ron Tarrant
Aug 18, 2019
Ron Tarrant
Aug 18, 2019
Ron Tarrant
Aug 18, 2019
Andre Pany
Aug 18, 2019
Ron Tarrant
August 16, 2019
Continuing on with Cairo, this post covers loading and displaying three types of image (including a structured drawing) using two different load-n-display methods.

As an extra bonus, you'll see a photo of my cat, Bob, and three of the seven guitars I've found in my building's recycle room over the last year.

https://gtkdcoding.com/2019/08/16/0062-cairo-vi-load-display-images.html

August 16, 2019
On Friday, 16 August 2019 at 11:42:01 UTC, Ron Tarrant wrote:
> Continuing on with Cairo, this post covers loading and displaying three types of image (including a structured drawing) using two different load-n-display methods.
>
> As an extra bonus, you'll see a photo of my cat, Bob, and three of the seven guitars I've found in my building's recycle room over the last year.
>
> https://gtkdcoding.com/2019/08/16/0062-cairo-vi-load-display-images.html

Amazing! You might be able to answer me something, whether you could use gtkd solely for image manipulation using ex. Pixbuf? or would it only work with the internals of gtkd? Like can you manipulate the image and save it to disk etc.

August 16, 2019
On Friday, 16 August 2019 at 11:42:01 UTC, Ron Tarrant wrote:
> Continuing on with Cairo, this post covers loading and displaying three types of image (including a structured drawing) using two different load-n-display methods.
>
> As an extra bonus, you'll see a photo of my cat, Bob, and three of the seven guitars I've found in my building's recycle room over the last year.
>
> https://gtkdcoding.com/2019/08/16/0062-cairo-vi-load-display-images.html

Thanks a lot Ron, your page is really helpful.
Is there a reason why the source code starts after a lot of whitespaces on every line?
This causes some distruction on mobile phone as you have scroll horizontally although it would fit the screen if the source code would start at column 0.

Kind regards
Andre
August 17, 2019
On Friday, 16 August 2019 at 12:44:15 UTC, bauss wrote:

> Amazing! You might be able to answer me something, whether you could use gtkd solely for image manipulation using ex. Pixbuf? or would it only work with the internals of gtkd? Like can you manipulate the image and save it to disk etc.

Those are very good questions, bauss. I haven't dug in that deep yet, but I see no reason why Cairo couldn't be used to build a full-featured paint, manipulation, or structured drawing application. But it won't only be about Pixbufs. The Cairo Context seems to be where all the action is as far as drawing routines go.

Over the next few months, off and on, I'll be exploring stuff like that. I'm still working on getting through all the unsexy stuff first (the basic widgets) but every once in a while, I just have to let my hair down and do something that's a bit more complex.

After the basic image and drawing stuff is covered, I'll be digging into simple animation and how to tame the Timeout. Then, after a short side-trip to finish off MVC and do some more base-level widgets such as the Toolbar, Statusbar, and Expander, there's another Cairo miniseries coming up that covers nodes and noodles, something I've wanted to dig into for several years.

Thanks for reading and thanks for the kind words.

August 17, 2019
On Friday, 16 August 2019 at 12:58:23 UTC, Andre Pany wrote:

> Thanks a lot Ron, your page is really helpful.

You're welcome, Andre. And thanks for saying so.

> Is there a reason why the source code starts after a lot of whitespaces on every line?
> This causes some distruction on mobile phone as you have scroll horizontally although it would fit the screen if the source code would start at column 0.

Thanks for bringing this to my attention. I've recently switched from basic MD for displaying source and the way I was doing it demanded that everything be indented one tab. I've since switched to Jekyll/Liquid's {% highlight d %} system which doesn't have this limitation.

Now that I know this is an issue, give me a some time and I'll get all those extra indents removed.


August 17, 2019
On Saturday, 17 August 2019 at 19:22:54 UTC, Ron Tarrant wrote:
> On Friday, 16 August 2019 at 12:44:15 UTC, bauss wrote:
>
>> Amazing! You might be able to answer me something, whether you could use gtkd solely for image manipulation using ex. Pixbuf? or would it only work with the internals of gtkd? Like can you manipulate the image and save it to disk etc.
>
> Those are very good questions, bauss. I haven't dug in that deep yet, but I see no reason why Cairo couldn't be used to build a full-featured paint, manipulation, or structured drawing application. But it won't only be about Pixbufs. The Cairo Context seems to be where all the action is as far as drawing routines go.
>
> Over the next few months, off and on, I'll be exploring stuff like that. I'm still working on getting through all the unsexy stuff first (the basic widgets) but every once in a while, I just have to let my hair down and do something that's a bit more complex.
>
> After the basic image and drawing stuff is covered, I'll be digging into simple animation and how to tame the Timeout. Then, after a short side-trip to finish off MVC and do some more base-level widgets such as the Toolbar, Statusbar, and Expander, there's another Cairo miniseries coming up that covers nodes and noodles, something I've wanted to dig into for several years.
>
> Thanks for reading and thanks for the kind words.

Thank you for the answer.

I'll take a look at it myself sometime in the near future and see what I can come up with and if I can figure it out :)

Also thank you for these blog posts. I enjoy reading them, also the MVC ones.
August 17, 2019
On Friday, 16 August 2019 at 12:58:23 UTC, Andre Pany wrote:

> This causes some distruction on mobile phone as you have scroll horizontally although it would fit the screen if the source code would start at column 0.

That didn't take as long as I thought it would. I removed all excess indentation, so let me know if it's any better now.

August 18, 2019
On Saturday, 17 August 2019 at 23:40:10 UTC, Ron Tarrant wrote:
> On Friday, 16 August 2019 at 12:58:23 UTC, Andre Pany wrote:
>
>> This causes some distruction on mobile phone as you have scroll horizontally although it would fit the screen if the source code would start at column 0.
>
> That didn't take as long as I thought it would. I removed all excess indentation, so let me know if it's any better now.

It looks a lot better now. I noticed you use an indentation level of 8 spaces. Is this by purpose? As far as I know, 4 spaces is recommended.

Kind regards
Andre
August 18, 2019
On Sunday, 18 August 2019 at 09:28:30 UTC, Andre Pany wrote:

> II noticed you use an indentation level of 8 spaces. Is this by purpose? As far as I know, 4 spaces is recommended.

I only use three in PS Pad, so the extra spaces are being inserted by either Perl, Jekyll, Liquid, or some part of the GitHub Pages site.

Is it possible it's an interpretation layered on by the web browser on your phone?
I don't know enough about how browsers work to determine whether or not this is a valid question.
August 18, 2019
On Sunday, 18 August 2019 at 14:18:23 UTC, Ron Tarrant wrote:
> On Sunday, 18 August 2019 at 09:28:30 UTC, Andre Pany wrote:
>
>> II noticed you use an indentation level of 8 spaces. Is this by purpose? As far as I know, 4 spaces is recommended.
>
> I only use three in PS Pad, so the extra spaces are being inserted by either Perl, Jekyll, Liquid, or some part of the GitHub Pages site.
>
> Is it possible it's an interpretation layered on by the web browser on your phone?
> I don't know enough about how browsers work to determine whether or not this is a valid question.

Hm I am not sure, i just tried lynx (on raspberry pi) and here also the indentation level are 8 spaces.

Kind regards
Andre
« First   ‹ Prev
1 2