<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум Александра Климова — Работаем с графикой. Основы]]></title>
		<link>http://forum.alexanderklimov.ru/viewtopic.php?id=17</link>
		<atom:link href="http://forum.alexanderklimov.ru/extern.php?action=feed&amp;tid=17&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Работаем с графикой. Основы.]]></description>
		<lastBuildDate>Wed, 17 Jan 2018 20:42:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1044#p1044</link>
			<description><![CDATA[<p>Код копировал несколько раз, проверял все. Так же нашел ошибку в Activity_main: Custom view Draw2D is not using the 2- or 3-argument View constructors; XML attributes will not work . Но решение, предложенное в интернете, не помогло, да и, мне кажется, это не связанные проблемы. Я так понимаю, что нет объекта Bitmap, хотя он, по идее, импортируется из пакета. Не может быть, что пакет устарел? Либо может я что-то упустил из виду?</p>]]></description>
			<author><![CDATA[null@example.com (kykara4a)]]></author>
			<pubDate>Wed, 17 Jan 2018 20:42:16 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1044#p1044</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1039#p1039</link>
			<description><![CDATA[<p>Вам написали - нет такого объекта. Как-то странно вы копируете код.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Tue, 16 Jan 2018 19:29:50 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1039#p1039</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1038#p1038</link>
			<description><![CDATA[<p>При запуске выдает ошибку. Скопировал Ваш исходный код, при запуске говорит: </p><div class="codebox"><pre><code>java.lang.NullPointerException: Attempt to invoke virtual method &#039;int android.graphics.Bitmap.getWidth()&#039; on a null object reference
 at com.example.serdechenko.simplepaint.draw2d.onDraw(draw2d.java:85)
 at android.view.View.draw(View.java:16217)
 at android.view.View.updateDisplayListIfDirty(View.java:15214)
 at android.view.View.draw(View.java:15987)
 at android.view.ViewGroup.drawChild(ViewGroup.java:3610)
 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400)
 at android.view.View.updateDisplayListIfDirty(View.java:15209)
 at android.view.View.draw(View.java:15987)
 at android.view.ViewGroup.drawChild(ViewGroup.java:3610)
 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400)
 at android.view.View.updateDisplayListIfDirty(View.java:15209)
 at android.view.View.draw(View.java:15987)
 at android.view.ViewGroup.drawChild(ViewGroup.java:3610)
 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400)
 at android.view.View.updateDisplayListIfDirty(View.java:15209)
 at android.view.View.draw(View.java:15987)
 at android.view.ViewGroup.drawChild(ViewGroup.java:3610)
 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400)
 at android.view.View.updateDisplayListIfDirty(View.java:15209)
 at android.view.View.draw(View.java:15987)
 at android.view.ViewGroup.drawChild(ViewGroup.java:3610)
 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400)
 at android.view.View.draw(View.java:16220)
 at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2692)
 at android.view.View.updateDisplayListIfDirty(View.java:15214)
 at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:283)
 at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:289)
 at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:324)
 at android.view.ViewRootImpl.draw(ViewRootImpl.java:2651)
 at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2470)
 at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2103)
 at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
 at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6064)
 at android.view.Choreographer$CallbackRecord.run(Choreographer.java:860)
 at android.view.Choreographer.doCallbacks(Choreographer.java:672)
 at android.view.Choreographer.doFrame(Choreographer.java:608)
 at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:846)
 at android.os.Handler.handleCallback(Handler.java:742)
 at android.os.Handler.dispatchMessage(Handler.java:95)
 at android.os.Looper.loop(Looper.java:157)
 at android.app.ActivityThread.main(ActivityThread.java:5571)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)</code></pre></div><p>я так понимаю, что не нравится ему метод getweight. Заменил его на цифровое значение, ничего не изменилось. В чем может быть проблема?</p>]]></description>
			<author><![CDATA[null@example.com (kykara4a)]]></author>
			<pubDate>Tue, 16 Jan 2018 15:21:44 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1038#p1038</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=759#p759</link>
			<description><![CDATA[<p>Перепроверил, у меня такой ошибки не было. Но переписал немного пример, чтобы избежать подобной ошибки.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Tue, 04 Apr 2017 18:53:21 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=759#p759</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=753#p753</link>
			<description><![CDATA[<p>&gt; <strong>gekkelberryfin87</strong>: креш после метода canvas.restore();</p><p>Тоже столкнулся. Текст ошибки: &quot;Underflow in restore - more restores than saves&quot;. Вылечил, добавив canvas.save() перед блоком о лучике солнца. Если поставить save прямо перед restore - ошибка тоже пропадет, но котик рисуется под углом, так же, как &quot;лучик солнца&quot;.</p>]]></description>
			<author><![CDATA[null@example.com (NeferSky)]]></author>
			<pubDate>Tue, 04 Apr 2017 12:34:14 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=753#p753</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=698#p698</link>
			<description><![CDATA[<p>Нужно почитать сообщения об ошибках, там должно быть все описано.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Mon, 27 Feb 2017 11:58:57 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=698#p698</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=695#p695</link>
			<description><![CDATA[<p>Здравствуйте! Подскажите пожалуйста из за чего может происходить креш после метода canvas.restore();<br />но если заменить на обратный поворот canvas.rotate(+45, x + mRect.exactCenterX(), y + mRect.exactCenterY());<br />то все работает.</p>]]></description>
			<author><![CDATA[null@example.com (gekkelberryfin87)]]></author>
			<pubDate>Mon, 27 Feb 2017 11:39:33 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=695#p695</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=694#p694</link>
			<description><![CDATA[<p>Слева расположена структура вашего проекта. Когда вы создавали свой проект, то задавали имя пакету, например, com.example.hellokitty. Вот этот пакет и ищете в левой части.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Mon, 27 Feb 2017 10:23:25 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=694#p694</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=693#p693</link>
			<description><![CDATA[<p>Александр, здравствуйте.<br />Поясните пожалуйста что значит &quot;Щёлкаем правой кнопкой мыши на имени пакета&quot;<br />в этом уроке <a href="http://developer.alexanderklimov.ru/android/simplepaint.php">http://developer.alexanderklimov.ru/and … epaint.php</a><br />Не могу понять куда всё-таки надо щёлкать(</p>]]></description>
			<author><![CDATA[null@example.com (Novice)]]></author>
			<pubDate>Mon, 27 Feb 2017 04:49:04 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=693#p693</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=643#p643</link>
			<description><![CDATA[<p>Приветствую. Во-первых ОГРОМНАЯ благодарность за уроки и низкий поклон.<br />По поводу этого урока, пробовал сделать картинку зависимой от размера экрана.<br />Самое трудное оказалось попасть &quot;лучиком&quot; в солнышко <img src="http://forum.alexanderklimov.ru/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />В результате пришел к выводу, что поворот лучше делать не относительно центра экрана mRect.exactCenter X/Y<br />, а относительно самого &quot;солнышка&quot; т.е. <br /></p><div class="codebox"><pre><code>        int radius = (screenWidth + screenHeight)/30;
        int sunX = screenWidth*7/8;
        int sunY = screenHeight*1/8;
        canvas.drawCircle(sunX, sunY, radius, mPaint);
...
        canvas.rotate(-45, sunX, sunY);</code></pre></div><p>просто хотел поделиться <img src="http://forum.alexanderklimov.ru/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (misha)]]></author>
			<pubDate>Fri, 04 Nov 2016 00:05:16 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=643#p643</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=532#p532</link>
			<description><![CDATA[<p>Не помню, может и нет такого урока. Вам нужно определить конструктор с параметрами атрибутов и будет вам счастье.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Sat, 14 May 2016 13:13:25 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=532#p532</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=530#p530</link>
			<description><![CDATA[<p>Подскажите пожалуйста, в каком уроке рассматривается размещение класса Draw2D в разметке activity_main рядом с остальными кнопками.</p>]]></description>
			<author><![CDATA[null@example.com (anh2000)]]></author>
			<pubDate>Sat, 14 May 2016 10:40:22 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=530#p530</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=167#p167</link>
			<description><![CDATA[<p>Экземпляр класса работает сам по себе и вызывает свой метод onDraw() автоматически, когда ему надо что-то отобразить на экране. И работать с Canvas нужно в самом объекте, а не в MainActivity.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Fri, 16 Oct 2015 07:47:38 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=167#p167</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=164#p164</link>
			<description><![CDATA[<p>Возник вопрос.<br />Если вместо разметки мы указываем экземпляр класса, то каким образом он выводит метод onDraw()? И что необходимо передавать как Canvas в главном метода MainActivity?</p>]]></description>
			<author><![CDATA[null@example.com (RATlius)]]></author>
			<pubDate>Thu, 15 Oct 2015 20:01:19 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=164#p164</guid>
		</item>
		<item>
			<title><![CDATA[Re: Работаем с графикой. Основы]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=157#p157</link>
			<description><![CDATA[<p>В реальности такой подход не часто используется. Конкретно, в ImageView так не получится, у него нет нужных методов. В моем примере показана простейшая реализация View. Но к нему можно добавить дополнительные конструкторы и тогда класс Draw2D будет выглядеть как остальные компоненты и его можно будет разместить в разметке activity_main рядом с остальными кнопками и т.п. Это есть в других уроках на сайте.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Thu, 08 Oct 2015 07:52:50 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=157#p157</guid>
		</item>
	</channel>
</rss>
